Skip to content

Instantly share code, notes, and snippets.

@bnvk
Created March 26, 2010 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnvk/345184 to your computer and use it in GitHub Desktop.
Save bnvk/345184 to your computer and use it in GitHub Desktop.
echo implode($geo_data);
67.160.143.219USUnited StatesOregonPortland45.5184-122.655-8-8-7
echo print_r($geo_data);
Array ( [ip] => 67.160.143.219 [country_code] =>
SimpleXMLElement Object ( [0] => US ) [country_name] =>
SimpleXMLElement Object ( [0] => United States ) [region_name] =>
SimpleXMLElement Object ( [0] => Oregon ) [city] =>
SimpleXMLElement Object ( [0] => Portland ) [zip_postal_code] =>
SimpleXMLElement Object ( ) [latitude] =>
SimpleXMLElement Object ( [0] => 45.5184 ) [longitude] =>
SimpleXMLElement Object ( [0] => -122.655 ) [timezone] =>
SimpleXMLElement Object ( [0] => -8 ) [gmtoffset] =>
SimpleXMLElement Object ( [0] => -8 ) [dstoffset] =>
SimpleXMLElement Object ( [0] => -7 ) ) 16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment