views:

26

answers:

1

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
I like your name btw ;)
Ahmad Farid
haha thanks dude ;-)
PHPology