| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Help with Google Maps xml output|
| 7:03 am on Jul 15, 2007 (gmt 0)|
I use PHP 5.0
I am trying to read the PostalCodeNumber node from the Google Maps xml output below:
$xmlstr = "<xml>
<name>1600 amphitheatre mtn view ca</name>
1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA
<ThoroughfareName>1600 Amphitheatre Pkwy</ThoroughfareName>
$xml = new SimpleXMLElement($xmlstr);
$zipcode = $xml->AddressDetails->PostalCode->PostalCodeNumber;
for some reason it's not working. anyone got any ideas?
Thank you in advance for your help.
| 8:25 am on Jul 15, 2007 (gmt 0)|
maybe something like this will work:
|$zipcode = $xml->AddressDetails->Country->AdministrativeArea->SubAdministrativeArea->Locality-> |
| 9:56 am on Jul 15, 2007 (gmt 0)|
the example of the xml output that is on the Google Maps API Documentation page is not correct.
I checked the xml output that I get back from Google and it does not contain the node "SubAdministrativeArea"
this gave me what i wanted $xml->Response->Placemark->AddressDetails->Country->AdministrativeArea->Locality->PostalCode->PostalCodeNumber
thank you for your help.
| 11:08 pm on Jul 15, 2007 (gmt 0)|
and i just noticed i had missed the "Response->Placemark->" in my suggested solution based on their example...
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
© Webmaster World 1996-2013 all rights reserved