A piece of phpcurl code, phpcurl code. A piece of phpcurl code: phpcurl code $ header [] Accept: imagegif, imagex-xbitmap, imagejpeg, imagepjpeg, applicationx-shockwave-flash, texthtml ,*. *; $ header [] a piece of phpcurl code and phpcurl code
$ Header [] = 'accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, text/html, *'. '/*'; $ header [] = 'Accept-Language: zh-cn'; $ header [] = "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv: 25.0) Gecko/20100101 Firefox/25.0 "; $ ch = curl_init (); // initialize curl // after curl is allowed to be submitted, the webpage redirects curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1); // return curl_setopt ($ ch, CURLOPT_HEADER, 1) for the header submitted by curl ); // recursively crawl LOCATION curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1); // The above process redirects curl_setopt ($ ch, CURLOPT_URL, $ url); // Set the link curl_setopt ($ ch, fail, FALSE); // HTTPS must be set not to verify curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, FALSE); // HTTPS must be set not to verify curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, TRUE ); // Set whether to return information curl_setopt ($ ch, CURLOPT_HTTPHEADER, $ header); // Set HTTP header $ html = curl_exec ($ ch ); // receive returned information curl_close ($ ch );
Authorization $ header [] = 'accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, text/html, *'. '/*'; $ header [] =...