Código PHP:
<?php
$url="http://ws.geonames.org/hierarchy?geonameId=5255148";
$gestor = file($url);
for($i=0;$i<count($gestor);$i++){
$title = eregi("<name>(.*)</name>",$gestor[$i],$out);
if(!empty($title)){
echo $out[0];
echo "<br>";
}
}
?>
me escupe esta respuesta:
Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD> <BODY></BODY> <META content=RDEOVFBQQB name=SKYPE_FRAMEID></HTML>