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
