php代码
function delline($file) { $fp = fopen($file,"r"); $tmp = tempnam("./","temp0"); $tmp_fp = fopen($tmp,"w"); $i=0; while(!feof($fp)){ $line = fgets($fp); if($i!=0){ fputs($tmp_fp,$line); } $i++; } fclose($fp); fclose($tmp_fp); rename($tmp,$file); }