Php reads html and captures the simple code of a string. Copy the code as follows :? Php $ title script home; $ hellojb51.net !; $ Filefile_get_contents (www.baidu.com); $ fileiconv (gbkIGNORE, UTF-8, $ file); echo $ file;
The code is as follows:
$ Title = 'foot home ';
$ Hello = 'jb51. net! ';
$ File = file_get_contents ('http: // www.baidu.com ');
$ File = iconv ("gbk // IGNORE", "UTF-8", $ file );
// Echo $ file;
Echo strpos ($ file ,''); <BR> echo substr ($ file, strpos ($ file,' <title> ') + 7, strpos ($ file ,''-Strpos ($ file ,'') + 7 ));
$ File = str_replace (array ('Baidu review ',' {hello} '), array ($ title, $ hello), $ file );
?>
The following is the program code of the thieves used by Yuhai. For more information, see. The script home provides a variety of thieves.
The code is as follows:
Function _ url ($ Date ){
$ Ch = curl_init ();
$ Timeout = 5;
Curl_setopt ($ ch, CURLOPT_URL, "$ Date ");
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1 )");
Curl_setopt ($ ch, CURLOPT_CONNECTTIMEOUT, $ timeout );
$ Contents = curl_exec ($ ch );
Curl_close ($ ch );
Return $ contents;
}
$ Url = "http://www.jb51.net ";
$ Contents. = _ url ($ url );
Echo $ contents; // Output Content
?>
The http://www.bkjia.com/PHPjc/320996.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/320996.htmlTechArticle code is as follows :? Php $ title = 'foot home'; $ hello = 'jb51. net! '; $ File = file_get_contents ('http: // www.baidu.com'); $ file = iconv ("gbk // IGNORE", "UTF-8", $ file ); // echo $ file ;...