要串接一个api
$url = "http://XXXX";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST,0);
$data = curl_exec($ch);
curl_close($ch);
$xml = simplexml_load_string($data);
print_r($xml);
但是页面显示是空的
我有echo $url 直接在firefox贴上 内容如下
<?xml version="1.0" encoding="utf-8"?>
<Result xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ReturnMsgNo>1</ReturnMsgNo>
<ReturnMsg>查询成功</ReturnMsg>
<ReturnData>
.....
</ReturnData>
</Result>
我有爬文过跟 #1BVEFCAW 这篇很像但是不知为何print就是空的
只好上来po文 求解 拜托各位大大了~