您好,欢迎访问一九零五行业门户网

responseXML没法取得结果

responsexml无法取得结果
代码如下:
上述代码只要引入了其他文件,注释部分
// include_once(../public/dbmanager.php);
// include_once(../public/stringconvert.php);
所示。
responsexml 便无法获取结果,并且执行到xmldoc.getelementsbytagname(firstname)[0].childnodes[0].nodevalue;
处程序便不再执行。
如果去掉include语句,程序运行正常。
上述引入的文件没有任何页面输出。
本人刚接触php ,请高手解答此为何故, 谢谢。
------解决方案--------------------
先看看xml是否正确返回的再说,调试功夫不能没有吧。
------解决方案--------------------
php数组与xml相互转换封装函数:xmlparse.php
php code#将数组转为xmlinclude(dirname(__file__)./xmlparse.php);$listtags = explode( ,name);$arr = array(1,name=>som,admin,100,array(name=>tom,lily));$contxml = dump_xml_config($arr, xml, utf-8);//放入文件//file_put_contents_safe(/path/test.xml,$contxml,w);echo $contxml;#源码### 10># som# admin1># 1002># # tom# lily0># 3>#
------解决方案--------------------
header('content-type: text/xml');
header(cache-control: no-cache, must-revalidate);
将这两句注释掉。将包含文件打开。打开错误提示功能,看是否报错。

其它类似信息

推荐信息