【发布时间】:2010-10-20 08:20:05
【问题描述】:
输入是一个类似http://ws.geonames.org/children?geonameId=6255148 的 URL,例如,我想在 SimpleXMLElement 中接收 XML 文件?
【问题讨论】:
标签: php xml web-services
输入是一个类似http://ws.geonames.org/children?geonameId=6255148 的 URL,例如,我想在 SimpleXMLElement 中接收 XML 文件?
【问题讨论】:
标签: php xml web-services
试试这个作为你的基点:
<?php
$xml = simplexml_load_file("http://ws.geonames.org/children?geonameId=6255148");
//print_r($xml);
foreach($xml->geoname as $geo)
{
echo $geo->toponymName . "<br />";
}
?>
【讨论】: