bla bla qwerty go go go
<?php$fn = "2.txt";$file=file($fn);$str = trim($file[0]);unset($file[0]);file_put_contents($fn, implode("",$file));echo $str;?>
function getLines($file) { $f = fopen($file, 'r'); if (!$f) throw new Exception(); while ($line = fgets($f)) { yield $line; } fclose($f); } foreach (getLines("someFile") as $line) { doSomethingWithLine($line); }
<?php $fn = "2.txt"; $file=file($fn); $str = trim($file[0]); unset($file[0]); file_put_contents($fn, implode("",$file)); echo $str; ?>
if ($file = fopen("file.txt", "r")) { while(!feof($file)) { $line = fgets($file); } fclose($file); }