# 删除无意义的空行 $str = preg_replace("/\r/", "\n", $str); #替换\n前面的空白字符为\n,然后把多个\n只留一个 $str = preg_replace("/\s+\n/", "\n", $str);
$str = preg_replace("/\t/"," ",$str); $str = preg_replace(array("'</head[^>]*?>.*?<'si",), array('</head><',), $str); echo $str; # "r"只读方式打开,指针指向文件头 $fp = fopen($fn, 'r'); $pos = 440;
# 把指针向后跳440字符 fseek($fp, $pos, SEEK_CUR);
# 读取当前行内容 $title = fgets($fp);