PHP obtains the function code of the url. Copy the code as follows: functiongeturl ($ url) {$ chcurl_init (); $ timeout5; curl_setopt ($ ch, CURLOPT_URL, $ url); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt ($ c
The code is as follows:
Function geturl ($ url)
{
$ Ch = curl_init ();
$ Timeout = 5;
Curl_setopt ($ ch, CURLOPT_URL, $ url );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_CONNECTTIMEOUT, $ timeout );
// Add the following two lines to the webpage for user detection:
// Curl_setopt ($ ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY );
// Curl_setopt ($ ch, CURLOPT_USERPWD, US_NAME. ":". US_PWD );
$ Contents = curl_exec ($ ch );
Curl_close ($ ch );
$ Contents = str_replace ("document. write ('", "", $ contents );
$ Contents = str_replace ("');", "", $ contents );
$ Contents = str_replace ("\ n", "", $ contents );
$ Contents = str_replace ("\", "", $ contents );
Echo $ contents;
}
The http://www.bkjia.com/PHPjc/324067.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/324067.htmlTechArticle code is as follows: function geturl ($ url) {$ ch = curl_init (); $ timeout = 5; curl_setopt ($ ch, CURLOPT_URL, $ url); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ c...