SimpleXML解析通过冒号PHP

SimpleXML解析通过冒号PHP,php,html,xml,parsing,simplexml,Php,Html,Xml,Parsing,Simplexml,嗨,我想访问XML提要中的值: <entry> <ilink:operation>store</ilink:operation> <ilink:type>ondemand</ilink:type> <id>736</id> <updated>2012-03-13T11:27:32Z</updated> <content type="application/xml"> &l

嗨,我想访问XML提要中的值:

<entry>
<ilink:operation>store</ilink:operation>
<ilink:type>ondemand</ilink:type>
<id>736</id>
<updated>2012-03-13T11:27:32Z</updated>
<content type="application/xml">
   <media:content>
      <ilink:parent_id>8132</ilink:parent_id>
      <ilink:availability_start>2012-01-06T00:00:00Z</ilink:availability_start>
      <ilink:availability_end>2012-02-03T00:00:00Z</ilink:availability_end>
      <ilink:duration>PT0S</ilink:duration>
   </media:content>
</content>

商店
ondemand
736
2012-03-13T11:27:32Z
8132
2012-01-06T00:00:00Z
2012-02-03T00:00:00Z
PT0
但是冒号挡道了。我如何访问它?这是我的密码:

$pictureBoxXMLFeed = simplexml_load_file('https://www.picturebox.tv/xml/feeds/FindAnyFilm/FindAnyFilm.xml');

foreach($pictureBoxXMLFeed->entry as $value){

    $hey = ($value->children('content')->children('media', true)->content->children('ilink', true)->parent_id);
    echo $hey;
    echo '<br/>';
}
$pictureboxmlfeed=simplexml\u load\u文件('https://www.picturebox.tv/xml/feeds/FindAnyFilm/FindAnyFilm.xml');
foreach($PictureBoxMLFeed->输入为$value){
$hey=($value->children('content')->children('media',true)->content->children('ilink',true)->parent\u id);
回声$hey;
回声“
”; }

但我只是得到一个错误列表。有人能帮我找到它吗?

您发布的XML在语法上不正确。没有结束标记,也没有名称空间定义。这在试图给出答案时引起了许多警告

一旦我在XML中解决了这些问题,我就使用以下方法来获得您似乎想要的东西:

foreach($pictureBoxXMLFeed->xpath('//content') as $content){
    $hey = ($content->children('media', true)->content->children('ilink', true)->parent_id);
    echo $hey;
    echo '<br/>';
}
foreach($pictureboxmlfeed->xpath('//content')作为$content){
$hey=($content->children('media',true)->content->children('ilink',true)->parent\u id);
回声$hey;
回声“
”; }
您发布的XML在语法上不正确。没有结束标记,也没有名称空间定义。这在试图给出答案时引起了许多警告

一旦我在XML中解决了这些问题,我就使用以下方法来获得您似乎想要的东西:

foreach($pictureBoxXMLFeed->xpath('//content') as $content){
    $hey = ($content->children('media', true)->content->children('ilink', true)->parent_id);
    echo $hey;
    echo '<br/>';
}
foreach($pictureboxmlfeed->xpath('//content')作为$content){
$hey=($content->children('media',true)->content->children('ilink',true)->parent\u id);
回声$hey;
回声“
”; }
您可以比“错误列表”做得更好。确定我得到-警告:main():第24行的/vagrant/LucidSite/PictureBox/PictureBox/trunk/services/dynamiccreel.php中不再存在节点致命错误:调用成员函数children()在第24行的/vagrant/LucidSite/PictureBox/PictureBox/trunk/services/dynamiccreel.php中的非对象上,可能的重复项比“错误列表”更好。确定我得到-警告:main():第24行的/vagrant/LucidSite/PictureBox/PictureBox/trunk/services/dynamiccreel.php中不再存在节点致命错误:调用成员函数children()在第24行的/vagrant/LucidSite/PictureBox/PictureBox/trunk/services/dynamiccreel.php中的非对象上