//PHP过滤清理文本文件的空行
$lines = file('./from.php');
$i=1;
$newFile = '';
foreach ($lines as $line_num => $line) {
$line2 = preg_replace('/\s/i','',$line);
if($line2)
{
$newFile .=$line;
}
}
$fp = @fopen('./to.php', "w"); //以写的方式打开文件
@fputs($fp, $newFile);
@fclose($fp);