<Placemark id="p1"></Placemark>
<Placemark id="p2"></Placemark>
<Placemark id="p3"></Placemark>
<Placemark id="p4"></Pl开发者_如何转开发acemark>
hi,im using SimpleXMLElement in my php, my question is,how do i get placemark id 3? is that something like this ?
$page = utf8_encode(file_get_contents($request_url));
$xml = new SimpleXMLElement($page);
$xml->Response->Placemark['id=p3']->AddressDetails->Country->CountryName;
thanks
$xml->xpath("Placemark[@id='p3']")->AddressDetails->Country->CountryName;
XPath is your friend :-)
精彩评论