php find ip address code example
Example 1: php get location from ip address
$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
echo $details->city; // -> "Mountain View"
Example 2: php get ip address
$clientIPAddress=$_SERVER['REMOTE_ADDR'];