CopyCode The 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;
Echo strpos ($ file, '<title> ');
Echo substr ($ file, strpos ($ file, '<title>') + 7, strpos ($ file, '</title>'-strpos ($ file, '<title>') + 7 ));
$ File = str_replace (Array ('Baidu review ',' {Hello} '), array ($ title, $ Hello), $ file );
?>
The following is the Program code used by Yu Hai. For more information, see. The script home provides a variety of thieves. copy Code 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 $ con Tents;
}< br> $ url = "http://www.jb51.net";
$ contents. = _ URL ($ URL);
echo $ contents; // output content
?>