开发者

PHP -- SimpleXMLElement -- parsing im:image

How do I extract im:image elements. For instance, I can do this:

$feed=file_get_contents($url);
$xml = new SimpleXMLElement($feed);
$title = $xml->entry[0]->title;
$html = $xml->entry[0]->content;

But I can't get thi开发者_高级运维s:

$img = $xml->entry[0]->im;

How do I target those? I'm willing to use DOMDocument() as well.

EDIT:

<entry>
  <im:image height="55">
    http://foo.com/foo.jpg
  </im:image>
</entry>


The im is just a namespace. You want 'image' element, not im – Dmitri Snytkine 20 hours ago

Yes, that's true, and the clue I needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜