xml数据创建无法显示
<?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";
echo $doc->saveXML() . "\n";
echo "Saving only the title part:\n";
echo $doc->saveXML($title);
?>
echo 出来没有XML文件显示. 1 把你那些乱七八糟的echo输出去掉
2 添加合适的头信息
3 参看输出的页面源码
4 使用var_dump 调试变量
echo输出去掉 没有在header声明为xml
在第一行里加一下error_reporting(0);
header('Content-type: Application/msexcel');
页:
[1]