[請益] check simpleXML object的屬性

作者: youneverknow (睡覺一直想)   2014-11-26 11:57:37
小弟新手,請板上先進多指教
小弟的code需要檢查xml裡是否有某一個標籤
XML範例如下
<client>
<id>1171</id>
<address>1.1.1.1</address>
<time>149318</time>
<flashver>LNX9,0,124,2</flashver>
<dropped>931</dropped>
<avsync>-210965</avsync>
<timestamp>210965</timestamp>
<active/>
</client>
<client>
<id>1164</id>
<address>1.1.1.1</address>
<time>173845</time>
<dropped>0</dropped>
<avsync>-211103</avsync>
<timestamp>211103</timestamp>
<publishing/> <
作者: MOONRAKER (㊣牛鶴鰻毛人)   2014-11-26 12:07:00
用SimpleXMLIterator和->hasChildren()檢查非常好 (y)

Links booklink

Contact Us: admin [ a t ] ucptt.com