and yes I have Google'd it.
Code: Select all
$info = simplexml_load_file('http://api.hostip.info/?ip=72.65.29.163');
$country = $info->{'gml:featureMember'}->{'countryName'};
$coords = split(",", $info->ipLocation->{'gml:pointProperty'}->{'gml:Point'}->{'gml:coordinates'});
$lng = $coords[0];
$lat = $coords[1];
echo $country;
Thanks, in advance.
--EDIT--
Nevermind, I got it working I simply had to register the namespace, and use xpath.