开发者

Accessing XML value with PHP

开发者 https://www.devze.com 2023-02-20 10:39 出处:网络
How would you access the value of \'seconds\' within this XML code using PHP? <entry><yt:duration seconds=\'339\'/></entry>

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

精彩评论

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