【发布时间】:2014-04-08 07:24:59
【问题描述】:
从this URL 获取 XML:
$xml = simplexml_load_file('http://geocode-maps.yandex.ru/1.x/?geocode=37.71677,55.75208&kind=metro&spn=1,1&rspn=1');
print_r($xml) 显示已加载 XML,但 xpath 始终返回空数组。我试过了:
$xml->xpath('/');
$xml->xpath('/ymaps');
$xml->xpath('/GeoObjectCollection');
$xml->xpath('/ymaps/GeoObjectCollection');
$xml->xpath('//GeoObjectCollection');
$xml->xpath('precision');
为什么我有空数组?希望我只是错过了一些简单的东西。
【问题讨论】: