Process large file line by line

Wrapper for processing large files through a callable handler. Read more.

fork add to bundle source
function process_file_lines($file, $callback) { $f = fopen($file, 'r'); if ($f) { while ( ($line = fgets($f)) !== false) { $callback($line); } return true; } return false; }


load_function('process_file_lines'); process_file_lines('large_file.csv', function($line) { // do something with line });
← how to use this in app?
create log ...inout