Generally, php collection code can be used. here is a simple implementation code.
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
?>