Home  >  Article  >  Backend Development  >  php 用curl_exec获取页面数据问题

php 用curl_exec获取页面数据问题

WBOY
WBOYOriginal
2016-06-02 11:32:43990browse

phpcurl

图1-1
图片说明
图1-2
图片说明

代码如下:
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$contents = curl_exec($ch);
将页面取得的数据放到变量contents中,但执行print_r($contents),
打印出来的页面图2,与真实存在的页面的数据图1不一致(如上图1-1和图1-2,排序不一样)?这是为什么?

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