欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php讀取html并截取字符串的簡單代碼

 更新時間:2009年11月30日 20:03:20   作者:  
一般php采集代碼能用的到,這里只是簡單的實現(xiàn)代碼。

復(fù)制代碼 代碼如下:

<?php
$title='腳本之家';
$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('百度一下','{hello}'),array($title,$hello), $file);
?>

下面是渝海用的小偷程序代碼。大家可以多看下。腳本之家提供多款小偷程序。
復(fù)制代碼 代碼如下:

<?php
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.dbjr.com.cn";
$contents.=_url($url);
echo $contents; //輸出內(nèi)容
?>

相關(guān)文章

最新評論