Getting user location from an IP address

Want to retrieve information like the city, state, and country of a visitor from their IP address?

PHP example:

$details = json_decode(file_get_contents("{$ip}"));
echo $details->city;


jQuery example:

$.get("", function(response) {
}, "jsonp");



Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>