nn sarebbe più semplice:

codice:
$txt = file_get_contents("file.txt");
$txt = str_replace("cosa_da_cancellare","",$txt);
:master: