简单教程
提交运行
代码编辑器:
<?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); echo $xml->to , "<br>"; echo $xml->from , "<br>"; echo $xml->heading , "<br>"; echo $xml->body;
运行结果: