开发者

PHP HTML DOM to parse XML second result

开发者 https://www.devze.com 2023-03-23 23:39 出处:网络
I\'m using simple PHP HTML DOM to parse XML开发者_如何学C, it is that there are several tags with the same values​​, how I can display only the second label?I\'m guessing from your question you\'re

I'm using simple PHP HTML DOM to parse XML开发者_如何学C, it is that there are several tags with the same values​​, how I can display only the second label?


I'm guessing from your question you're using PHP Simple HTML DOM? http://simplehtmldom.sourceforge.net/

You should be able to get the second label by doing something like:

// $xml is your DOM object
$tags = $xml->find("label");
echo $tags[1];

If you're not using PHP Simple HTML DOM, let us know which you're using, as it'll be different depending on the code you're using.

0

精彩评论

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

关注公众号