简单教程
提交运行
代码编辑器:
<?php $note = <<<XML <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> XML; $xml = simplexml_load_string($note); foreach ($xml->children() as $child) { echo "Child node: " , $child , "<br>"; }
运行结果: