'; $end = '
'; $fd = fopen ($filename, "r"); $tpbuffer=""; $i = 0; while (!feof ($fd) && $i++ <= 13000) { $tpbuffer .= fgets($fd, 8192); } fclose ($fd); $tpbuffer = strstr($tpbuffer,$begin); $tppos = strpos($tpbuffer, $end); $tpbuffer = substr($tpbuffer,0,$tppos ); if ($_GET["header"] == 1) { $patterns = array( "/php\?/", "/href=\"\./" ); $replacements = array( "php?header=1&", 'href1="' ); $tpbuffer = preg_replace($patterns, $replacements, $tpbuffer); } $patterns= array ( "/体坛/", '/http:\/\/.+\.titan24\.com\/.+\/(\d+)\.html/', "/=\"\/userfiles\//", "/titan24\.com/" ); $replacements= array ("华体", 'http://scripts.sportscn.com/2008/newsdesc.html?tid=\\1', '="http://image.sportscn.com/nba/userfiles/', "sportscn.com" ); print preg_replace($patterns, $replacements, $tpbuffer); ?>