file xml:
<albums>
<album>
<name>My Album 1</name>
<created>2014-05-14</created>
</album>
</albums>
当我将数据附加到文件时,结果如下所示:
<albums>
<album>
<name>My Album 1</nam>
<created>2014-05-15</created>
</album><album><name>My Album 2</name><created>2014-05-15</created></album></albums>
我希望结果如下:
<albums>
<album>
<name>My Album 1</nam>
<created>2014-05-15</created>
</album>
<album>
<name>My Album 2</name>
<created>2014-05-15</created>
</album>
</albums>
我怎么能这样做?
答案 0 :(得分:0)
在php中的XML之前添加以下内容,它将相应地对齐
header('Content-type:text/xml');