I have a script which, each time is called, gets the first line of a file. Each line is known to be exactly of the same length (32 alphanumeric chars) and terminates with \"
I came up with this idea yesterday:
function read_and_delete_first_line($filename) { $file = file($filename); $output = $file[0]; unset($file[0]); file_put_contents($filename, $file); return $output; }