Menu

Check My IP – How To Check IP in PHP | Check Your IP Address in PHP

PHP By Aug 21, 2012 No Comments

Today we will discuss How to Check IP address in PHP. we use a single line code for getting the IP Address and than another single line to show it. It just a 10 second script.

In this we will use $_SERVER[“REMOTE_ADDR”]. – We will put $_SERVER[“REMOTE_ADDR”] into a variable and than we will echo that variable. It will show us the IP address. Below is the code sample and the IP your PC.

<?php
$ip=$_SERVER["REMOTE_ADDR"];
echo $ip;
?>

It will show your IP.

Happy Coding.

Author

Hello i am Vivek Moyal PHP developer and writes tutorials for students and beginners. Love to explore new cities

No Comments

Leave a comment

Your email address will not be published. Required fields are marked *