Hi Guys,
I have my xml file I want to extract the label name by searching an
xml file for country code.
<markers>
<marker continent="na" zoom="7" label="Guatemala" cc="gt" />
</markers>
I have the following php code to match cc. I get an error that says :
Object of class DOMNodeList could not be converted to string on the
for loop.
$doc = new DOMDocument();
$doc->load( 'http://www.mysite.com/files/english/
countries.xml' );
$markers = $doc->getElementsByTagName("marker");
for ($i = 0; $i < strlen($markers); $i++)
{
$countrycode = $markers[i].getAttribute("cc");
$label = $markers[i].getAttribute("label");
if(strtolower($ucountrycode) == strtolower($countrycode))
{
echo "<script>alert(\"$label\");</script>";
}
else{
}
}
Do i need to comvert $markers to string?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---