我是新來的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