"; foreach ($lines as $line) { if(ereg($here_document,$line) && ereg("<<<",$line)) $out.= cleanup($line)."\n"; else if(ereg("$here_document;",$line)) $out.= "\n".cleanup($line)."\n"; else $out.= trim(cleanup($line))." "; } $out = preg_replace('/(\/\*[\s\S]*?\*\/)/', '', $out); // remove multi-line comments /* */ file_put_contents($argv[1],trim($out)); // store back to file echo count(file($argv[1]))."\n"; ?>