Using PHP and fopen, I can open a file, even run while statements, however, on larger files, the scripts look stalled. How do I pull a file and print out line by line or at least in chunks so that the user sees the output as it's coming through?
You may use ob_start(); and ob_end_flush(); functions to print out whole text after reading it from the file. You ma read it line by line print it out into the buffer in some variable: echo $newLineFromFile; PHP: after running ob_start(); function. Buffer creates automatically after this function was run. After the whole file was printed out into the buffer run the ob_end_flush(); function and all buffer will be printed out into the browser.
if you use fgets() to retrieve data and only pass the resource name to it, it will return data line by line ( \n ), as others have suggested on larger files clearing of the buffer / cache is necessary, also set_time_limit(0); is a good idea. If you're a little more specific about what you want to do with the data line by line we can probably be of more constructive help.