开发者

Accessing XML value with PHP

How would you access the value of 'seconds' within this XML code using PHP?

<entry><yt:duration seconds='339'/></entry>

So far I have:

$xml -> entry -> ?!?

For Serty:

<?xml version='1.0' encoding='UTF-8'?&g开发者_如何学Ct;


Well, what you are looking for is called an attribute. If you are using php to parse your xml, then I would look at http://php.net/manual/en/domelement.getattribute.php, and find a comment that helps you.

Without knowing how you are parsing it though, I can't help much more

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜