开发者

Can PHP SimpleXML be used for this task?

I'm loo开发者_如何学JAVAking to run some kind of loop on some optional XML data.

Nodes would potentially look like this:

<link1>
 <url>http://www.bleh.com</url>
 <text>Click here</text>
</link1>
<link2>
 <url>bleh.com</url>
 <text>Click here</text>
</link2>

What would be the best method to determine if these nodes exist and parse them accordingly?


If you're using SimpleXML, then you can simply use isset() to determine whether a node exists.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜