<?
// your file...
$filePath = 'path/to/file.txt';
//build an array of lines we'd like to exclude
$excludeLines = array('3','6','7');
//parse the file to an array ala perl
$fileLines - file($filePath);
//now loop for string output
for ($i=0;$i<count($fileLines);$i++) {
if (!in_array($i,$excludeLines)) {
//if we don't see this row as flagged, we append to a string.
$packLines .= $fileLines[$i];
}
}
//now write the string into the file... will overwrite last file contents.
$fp = fopen($filePath,'w');
fwrite($fp,$packLines);
fclose($fp);
?>