呵呵,o(∩_∩)o...我也来灌灌水。。
程序以后再讲,现在没时间了,先发表上。。
代码如下:
<base target=_blank>
<?PHP
$str="http://www.rzpt.cn";
$lines=file($str);
//echo strlen($lines);
/* foreach($lines as $line_num=>$line){
echo "Line #<b>{$line_num}</b>:".htmlspecialchars($line)."<br>";
}
*/
$result_string=join(" ",$lines);
//echo $result_string;
$search_one="<FONT color=#FFC184>·</FONT></TD>";
$result_string=strstr($result_string,$search_one);
//echo $result_string;
$position=strpos($result_string,"</tr></td>");
//echo "[$position]";
$result_string=substr($result_string,0,$position);
//echo $result_string;
$result_string=ereg_replace("<TD height=\"16\" class=news>"," ",$result_string);
$result_string=ereg_replace("<TD width=\"2%\" height=16>"," ",$result_string);
$result_string=ereg_replace("</TD>"," ",$result_string);
$result_string=ereg_replace("<TR>","◇ ",$result_string);
$result_string=ereg_replace("<FONT color=#FFC184>·</FONT>","",$result_string);
//$result_string=ereg_replace("\n\r","◇",$result_string);
$result_string=ereg_replace("href=\"","<a href=\"http://rzpt.cn/",$result_string);
//echo htmlspecialchars($result_string);
$result_array=explode("◇",$result_string);
///
for($i=0;$i<count($result_array);$i++){
$every_item=explode("◇",$result_array[$i]);
//echo $i.":<br>";
echo $result_array[$i]."<br>";
}
?>
|