Home  >  Article  >  Backend Development  >  curl无法打印出全部结果

curl无法打印出全部结果

WBOY
WBOYOriginal
2016-06-23 13:09:051528browse

$data='district=上海&authkey=a70624e6e16b42e59618ecc38c93fdde';
$curl=curl_init();
curl_setopt($curl, CURLOPT_URL,'http://web.36wu.com/WeatherService.asmx/GetWeather');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST,1);
curl_setopt($curl, CURLOPT_POSTFIELDS,$data);
$out=curl_exec($curl);
var_dump($out);

打印结果
string '

  200
  OK
  
    101020100
    上海
    上海
    上海
    2016-04-20
    19度
    20
    24
    小雨转多云'... (length=708)
这是为毛


回复讨论(解决方案)

右键-查看源码 就能看到了

你这个接口地址是自己的还是别人的啊 , 要是你自己的 就去看看 是不是你接口返回值自己截取了, 感觉不像是你这边的问题,应该是接口那边返回值处理了,你var_dump应该全部都可以看到。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:函数问题Next article:php数组的问题