0
我正在從mysql數據生成xml代碼。但它會在每個節點之前重複生成項目節點。請給我解決方法,如何刪除項目節點。我的代碼are.any幫助將不勝感激。從xml中刪除子節點
<?php
include("config.php");
header('Content-type: text/xml');
include 'XMLParser.class.php';
$qry = mysql_query("select * from store") or die(mysql_error());
$result = mysql_fetch_array($qry);
$xml = XMLParser::encode($result,'response');
echo $xml->asXML();
?>
輸出是項目節點在每個節點之前重複的地方。請建議我如何刪除這個項目節點:
<response><item>3</item><id>3</id><item>Oxxo</item><name>Oxxo</name><item>avatar.png</item><image>avatar.png</image><item>ludhiyana</item><address>ludhiyana</address><item>9:00-17:00</item><open_close>9:00-17:00</open_close><item>dfsghxg</item><city>dfsghxg</city><item>465476</item><phone>465476</phone><item>0</item><drop_ins>0</drop_ins><item>500</item><cost>500</cost><item>0</item><include_mats>0</include_mats><item>400</item><mat_fee>400</mat_fee><item>28.6139391,77.20902120000005</item><lat_long>28.6139391,77.20902120000005</lat_long><item>2015-02-03
15:46:582015-02-03 15:46:5811
非常感謝。它確實給出了結果 – 2015-02-11 10:56:51