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.
精彩评论