大家看一下,难道php永远不支持gb2312的xml吗? 怎么可能不支持呢...http://www.chinaz.com/rss.php看一下这个地址你就知道了. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?$doc = new DOMDocument('1.0','gb2312');$doc->formatOutput = true;$root = $doc->createElement('book');$root = $doc->appendChild($root);$title = $doc->createElement('title');$title = $root->appendChild($title);$text = $doc->createTextNode('你好');$text = $title->appendChild($text);$doc->save("x.xml");?> 楼上的"php匪徒",我刚才运行了你的代码,提示错误如下:Warning: DOMDocument::save() [function.DOMDocument-save]: output conversion failed due to conv error, bytes 0xC4 0xE3 0xBA 0xC3 in F:\php\postxml.php on line 15 PHP梦之队,难道你测试下面代码也不报错吗?$doc = new DOMDocument('1.0','gb2312'); $doc->formatOutput = true; $root = $doc->createElement('book'); $root = $doc->appendChild($root); $title = $doc->createElement('title'); $title = $root->appendChild($title); $text = $doc->createTextNode('你好'); $text = $title->appendChild($text); $doc->save("x.xml"); 关于浏览器的缓存,有点疑问 正则表达式----高手进~!! 高手看下这段代码怎样改,才能把dedecms的版权改过来 B/S模式下如何进行客户端绑定? [求助]ZF字符集问题 微信公众平台,php开发的简单问题 插入mysql前,为什么有的程序不进行addslashes反而进行stripslashes? 关于显示MySQL数据库的记录的问题(在线等) 这些网站的php简繁体转换为什么会这么快啊?请大家帮忙看看啊,给100分 PHP中的小问题 array sort问题 一个php读写文件问题
$root = $doc->appendChild($root);$title = $doc->createElement('title');
$title = $root->appendChild($title);$text = $doc->createTextNode('你好');
$text = $title->appendChild($text);
$doc->save("x.xml");
?>
Warning: DOMDocument::save() [function.DOMDocument-save]: output conversion failed due to conv error, bytes 0xC4 0xE3 0xBA 0xC3 in F:\php\postxml.php on line 15
$doc->formatOutput = true;
$root = $doc->createElement('book');
$root = $doc->appendChild($root);
$title = $doc->createElement('title');
$title = $root->appendChild($title);
$text = $doc->createTextNode('你好');
$text = $title->appendChild($text);
$doc->save("x.xml");