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 think this is best for any file size
$myfile = fopen("yourfile.txt", "r") or die("Unable to open file!"); $ch=1; while(!feof($myfile)) { $dataline= fgets($myfile) . ""; if($ch == 2){ echo str_replace(' ', ' ', $dataline)."\n"; } $ch = 2; } fclose($myfile);