【发布时间】:2013-06-09 15:26:09
【问题描述】:
我在执行一个 curl 请求后得到了这样的响应。
<?xml version="1.0" encoding="utf-8"?>
<mp_response>
<response_element>
<merchantid>
36573dkjdkjds3987398
</merchantid>
<orderid>
1
</orderid>
<responsecode>
23
</responsecode>
<description>
Transaction Payout Completed
</description>
</response_element>
</mp_response>
但是当我使用类似的功能时
new SimpleXMLElement($xml_str);
simplexml_load_string($data)
等等。 我收到类似的错误
Start tag expected, '<' not found
我该怎么办?
【问题讨论】:
-
你能贴出你如何从 curl 中读取数据的代码吗,听起来你的字符串是 urlencoded
-
看起来您的
$xml_str或$data不包含任何 XML。
标签: php curl xml-parsing