IP Trace in PHP

Developers ONLY As a quick snippet I was asked: how do you get useful information from an IP Address? Once you have the variable which is the IP address assumed from some database or directly asĀ $_SERVER[‘REMOTE_ADDR’] create some PHP f() along the lines of: $ip = $_POST[‘ipAddress‘]; $locationDetails = json_decode(file_get_contents(“http://ipinfo.io/{$ip}/json”)); assuming the ipAddress is passed as a variable or in this case I’m assuming it’s an AJAX function hence the $_POST. The second line is the important one which creates

Continue Reading

Site Footer