<? $txt = file('txt.txt'); foreach($txt as $fl) { echo trim($fl)."@mail.ru"; } ?>
<?php $open = fopen('file.txt','a'); for($i=0;$i<count($A);$++){ fwrite($open,$A[$i]."\n"); } fclose($open) ?>