您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

DOMDocument:saveXML 返回值替空字符串

2026/2/16 15:30:43发布19次查看
domdocument::savexml 返回值为空字符串
php手册中的的实例:
$doc = new domdocument('1.0');
// we want a nice output
$doc->formatoutput = true;
$root = $doc->createelement('book');
$root = $doc->appendchild($root);
$title = $doc->createelement('title');
$title = $root->appendchild($title);
$text = $doc->createtextnode('this is the title');
$text = $title->appendchild($text);
echo saving all the document:\n;
$xmlcontent = $doc->savexml();
var_dump($xmlcontent);

打印出的结果是:
saving all the document: string(72)
为什么没有打印出完整的xml?请各位前辈指点,thanks! php savexml
分享到: format...' data-pics=''>
------解决方案--------------------
请在文本方式下查看saving all the document:
string(72)
this is the title

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product