formatOutput=true;$document=$doc1->createElement("document");$document=$doc1->appendC"/> formatOutput=true;$document=$doc1->createElement("document");$document=$doc1->appendC">

Home  >  Article  >  Backend Development  >  生成XML,字符转义解决方案

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

WBOY
WBOYOriginal
2016-06-13 13:17:151017browse

生成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是

我不想把这个转义,应该怎么处理一下,各们帮帮忙吧

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn