curl_setopt($curl, CURLOPT_HEADER, 1);
$data = curl_exec($curl); $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); // 根据头大小去获取头信息内容 $header = substr($data, 0, $headerSize); $data=[ ‘header‘=>$header, ‘data‘=>substr($data,$headerSize,-1), ];