php 生成xml高级

[复制链接]
查看11 | 回复0 | 2010-1-15 13:26:12 | 显示全部楼层 |阅读模式
我的方法很简单,也很百痴。有兴趣看看,写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文件?>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行