1
當我用FireFox或Opera打開這個頁面時,看起來都不錯(顯示xml樹),但是當用IE8或Chrome打開時,我在一行中得到這個xml文本。爲什麼?如何修復?xml tree with php + header
<?php
$xml = '
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer Guide</title>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
</book>
</catalog>';
header("Content-type: text/xml;charset:UTF-8");
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo $xml;
die;
?>