我是新来的XML,我有以下问题。 我的XML文件是这样的:使用simplexml_load_file()加载XML文件通过PHP - 文档末尾的额外内容
<?xml version="1.0" encoding="UTF-8"?>
<employees>
<employee>
<Name>John</Name>
<Surname>K</Surname>
<ID>234</ID>
<e-mail>[email protected]</e-mail>
</employee>
</employees>
</xml>
我试图通过PHP加载XML文件:
<?php
$filename='../DBfiles/employeesDB.xml';
$xml=simplexml_load_file($filename);
?>
和我得到以下几点:
Warning: simplexml_load_file(): ../DBfiles/employeesDB.xml:12: parser error : Extra content
at the end of the document in C:\path_to_my_file\www\phpAndAjax\add.php on line 4
Warning: simplexml_load_file(): </xml> in C:\path_to_my_file\www\phpAndAjax\add.php on
line 4
Warning: simplexml_load_file():^in C:\path_to_my_file\www\phpAndAjax\add.php on line 4
您还没有打开''。 –
0x47686F7374
2014-10-06 08:59:33