simplexml_load_string报错:XML declaration allowed only at the start of the document
来源:互联网 发布:linux安装mysql报错 编辑:程序博客网 时间:2024/06/06 00:15
xml数据,data里的为xml数据。注明:带有\r\n的。
{"status_code":200,"msg":true,"data":"\r\n\r\n\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?><response><error>0<\/error><message><\/message><\/response>\r\n\r\n"}
在进行转换为字符串simplexml_load_string的时候会报错:XML declaration allowed only at the start of the document。
解决办法:
rtrim($data) 加 ltrim($data)。曾经试过直接trim,但是不知为何不管用。
0 0
- simplexml_load_string报错:XML declaration allowed only at the start of the document
- php 输出xml错误不能解析,XML declaration allowed only at the start of the document
- XML declaration allowed only at the start of the document 问题解决方法
- asp输出xml格式文件时的一个诡异错误及解决方法:XML declaration allowed only at the start of the document
- 【XML码农】【Error】The XML declaration may only appear at the very beginning of the document.
- Cannot find the declaration of element 'beans' spring xml文件报错解决办法
- XML or text declaration not at start of entity
- XML文件要有根标签(Extra content at the end of the document in file 错误
- Unexpected XML declaration. The XML declaration must be the first node in the document and no white
- The Declaration of Independence
- Error:(6) Error parsing XML: XML or text declaration not at start of entity
- XML文件要有根标签(Extra content at the end of the document in file 错误)
- XML or text declaration not at start of entity异常的原因
- Android编译出现XML or text declaration not at start of entity
- 解决报错error the @annotation pointcut expression is only supported at Java 5
- Spring 配置文件报错: cvc-elt.1: Cannot find the declaration of element ""beans""
- maven项目报错:cvc-elt.1: Cannot find the declaration of element 'beans'.
- spring项目启动报错 cvc-elt.1: Cannot find the declaration of element 'beans'.
- 51nod 1270 数组的最大代价(基础dp)
- 先序创建二叉树及三种遍历
- 牛顿法(Newton's method)
- JS页面跳转和js对iframe进行页面跳转、刷新
- tensorflow使用tensorboard实现数据可视化
- simplexml_load_string报错:XML declaration allowed only at the start of the document
- min_free_kbytes
- caffe --Multi-GPU Usage
- Android Studio使用USB真机调试
- 微信、QQ、支付宝、微博授权登录的代码操作及相关问题
- 文奇的WY实习连载日记:5.17-如果你觉得生活很无聊,你去问一个程序员,他一天都做了什么。
- 查找算法
- Latex设置字体大小及编辑公式等命令
- 角谷猜想