function get($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPGET, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //TRUE 将curl_exec()获取的信息以字符串返回,而不是直接输出. $header = ['User-Agent: php test']; //设置一个你的浏览器agent的header curl_setopt($ch, CURLOPT…