formatOutput=true;$document=$doc1->createElement("document");$docu">
当前位置:Gxlcms > PHP教程 > 生成XML,字符转义解决方案

生成XML,字符转义解决方案

时间:2021-07-01 10:21:17 帮助过:5人阅读

生成XML,字符转义
$doc1=new DOMDocument("1.0","utf-8");
$doc1->formatOutput=true;
$document=$doc1->createElement("document");
$document=$doc1->appendChild($document);
$webname=$doc1->createElement("webname");
$webname=$document->appendChild($webname);
$webname->appendChild($doc1->createTextNode(xmlencode('')));
生成的xml是
<![CDATA[ test ]]>
我不想把<>这个转义,应该怎么处理一下,各们帮帮忙吧

------解决方案--------------------
xml有个createCDATASection
不需要你使用这个方式

人气教程排行