0
我通过加载XML
文件simplexml_load_file
PHP:获取XML的孩子没有父母
XML:
<list>
<top>
<test>
<id>1</id>
</test>
<test>
<id>2</id>
</test>
<test>
<id>3</id>
</test>
</top>
<test>
<id>4</id>
</test>
</list>
我想一个foreach
我没有得到所有TEST
标签使用top
亲代获得test
chilren
我怎么能?
PHP的文档http://php.net/manual/en/simplexmlelement.children.php有你想要做一个例子 – bumperbox
本例使用3的foreach –