Introduction: This is a detailed page in PHP that uses curl to determine whether an image or page is complete. It introduces PHP, curl, PHP, setopt, CH, header PHP uses curl to determine whether the image or page is complete related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 350530 'rolling = 'no'>
In PHP, curl is a good thing and can be used to determine whether a file or page can be opened. For example:
Function check_url ($ URL)
{
$ CH = curl_init ();
Curl_setopt ($ ch, curlopt_url, $ URL );
Curl_setopt ($ ch, curlopt_header, 1 );
Curl_setopt ($ ch, curlopt_returntransfer, 1 );
$ DATA = curl_exec ($ ch );
$ Headers = curl_getinfo ($ ch );
Curl_close ($ ch );
Return $ headers ['HTTP _ Code'];
}
$ Myurl = "http://www.XXX/XXX.JPG ";
$ Satus = check_url ($ myurl );
If ($ satus = '20140901 ')
Echo "its works ";
Else
Echo "Broken URL ";
We can see that this method uses curl to retrieve the status of the HTTP header.
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/350530.html pageno: 3