<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
set_time_limit(0);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標題文檔</title>
</head>
<body>
<?php
$filecontent = getcontent('http://111cn.net');
$start = 's;
$end ='b;
$art = 311;
$str = '';
preg_match('/<title>(.+?)</title>/', $filecontent, $arr);/* 取得標題*/
$init =explode($start,$filecontent);
$array = explode($end,$init[1]);
$str =$str.$arr[1].replaceHtml($array[0]);
function getcontent($url)
{
$retmsg=file_get_contents($url);
return $retmsg;
}
function savato($filename,$content){
if( !empty( $content ) ){
$info = fopen($filename,'w+');
fwrite($info,$content);
fclose($info);
echo "儲存檔案 $filename 成功<br>";
}else{
echo '文章更新失敗,<a href=get.php >點擊重新更新</a>';
}
}
function replaceHtml($str){
$temp = str_replace(' ',' ',$str);
$temp = str_replace('<BR>',chr(10),$temp);
$ return strip_tags($temp);
}
?>
</body>
</html>