0
<guid isPermaLink="false">

<title>iphone cover 4</title>

<media:price>$35.95</media:price>

<media:thumbnail url="http://rlv.zcache.com/22.jpg"/>

<media:content url="http://rlv.zcache.com/440.jpg"/>

上面是我要读取的xml文件,我可以得到titlemedia price甚至Guid的isPermalink属性。但我无法获取media:thumbnail 属性 下面是我的代码。

foreach ($xml->channel->item as $cool)
{
    $per = $cool->guid["isPermaLink"];
    $thumb = $cool->children('media', true)->price;
    $title = $cool->title;
    $thumb = $cool->children('media', true)->thumbnail["url"];
}

如何获取media:thumbnail 属性

4

1 回答 1

0

尝试循环浏览缩略图属性

foreach ($cool->children('media', true)->thumbnail as $thumb) {
   $URL = $thumb['url']
}
于 2013-01-03T12:19:22.847 回答