Input is a URL like this http://ws.geonames.org/children?geonameId=6255148 and I would like to receive the XML file in a SimpleXMLElement for example?
+2
A:
Try this as your base point:
<?php
$xml = simplexml_load_file("http://ws.geonames.org/children?geonameId=6255148");
//print_r($xml);
foreach($xml->geoname as $geo)
{
echo $geo->toponymName . "<br />";
}
?>
PHPology
2010-10-20 08:25:10
I like your name btw ;)
Ahmad Farid
2010-10-20 08:34:53
haha thanks dude ;-)
PHPology
2010-10-20 08:40:08