You are here

$_SERVER['REMOTE_ADDR'] the client IP address

Many have made very successful sites whose sole purpose is to echo the client IP address. A lot of tech heads have their favorites such as or, to name a couple. This is done simply by writing this script:

<?php echo $_SERVER['REMOTE_ADDR']; ?>

For example, your IP address is:

So, if you ever find yourself asking "What is my IP?" or "How can I get the IP of a user accessing my site?" then this is the way to do it in PHP.

IP Addresses that have accessed this site:

IP AddressNumber of visits heresort ascending