我的方法很简单,也很百痴。有兴趣看看,写xml其实不用哪么麻烦。 '; $xmlfile .= ' '; $allarraya = array($_POST[atextfield]); $allarrayb = array($_POST[btextfield]); $allarrayc = array($_POST[ctextfield]); //echo $_POST[atextfield][0]; //print_r ($_POST[atextfield]); while (list($key,$value) = each($_POST[atextfield])){$xmlfile .= '';$xmlfile .= '';$xmlfile .= '';$xmlfile .= ''.$_POST[ctextfield][$key].'';$xmlfile .= '
';}//xml文件 $xmlfile .= '';// $text=iconv("ISO-8859-1", "UTF-8", "$xmlfile"); //$text = iconv("UTF-8","gbk//TRANSLIT", $xmlfile); $text = mb_convert_encoding("$xmlfile", "gbk", "utf-8"); $fp=fopen("../fashion/$_GET[id]/mp3Player.xml","w");if(fwrite($fp,$text)){echo "写入文件成功!";unlink('../userfiles/mp3/'.$_GET[id].'/tmp.txt');exit;}else{echo "写入文件失败!";} exit; } //生成xml文件?> |