所以,我有这样的XML:http://mkweb.bcgsc.ca/color_summarizer/?xml=1&url=http://i.imgur.com/I1phTe1.png&precision=extreme为什么通过属性访问提取XML字段值时不返回值?
我试图提取rgb
和hex
其avg
。所以在这种情况下,这将是d7dfe2
由于从这里读到:
这是我到目前为止有:
$feed = file_get_contents("http://mkweb.bcgsc.ca/color_summarizer/?xml=1&url=http://i.imgur.com/I1phTe1.png&precision=extreme");
$xml = simplexml_load_string($feed);
echo $xml->imgdata->variable[9]->statistic[0]->hex;
然而,返回空白。
我在做什么错?
这就是...新的。谢谢,我不知道。 –
但是为什么原始代码'不工作'? simplexml不支持这种动态属性和访问吗?或者使用的表单有错误,如果有的话? – user2864740