data.txt中使用PHP将文本文件转换为xml?
ha15rs,250,home2.gif,2
ha36gs,150,home3.gif,1
ha27se,300,home4.gif,4
ha4678,200,home5.gif,5
我想使用SimpleXML模块使用PHP这个文本文件转换成XML?谢谢:))
p.s.即时通讯新本
编辑:
<allproperty>
<aproperty>
<postcode></postcode>
<price></price>
<imagefilename></imagefilename>
<visits></visits>
</aproperty>
<aproperty>
<postcode></postcode>
<price></price>
<imagefilename></imagefilename>
<visits></visits>
</aproperty>
<aproperty>
<postcode></postcode>
<price></price>
<imagefilename></imagefilename>
<visits></visits>
</aproperty>
</allproperty>
开始:'file()'将文件解析为行; '爆炸()'分裂列 – 2010-12-15 01:07:03
然后放在一起DOMDocument:http://stackoverflow.com/questions/1933563/creating-dynamic-xml-with-php并将其写入文件 – 2010-12-15 01:08:01
我的思维阅读今天有点慢。你能告诉我们你想要什么样的格式吗?谢谢。 – Jonah 2010-12-15 01:08:02