# Most memory-efficient way to split a variable sized chunks?
$handle = @fopen("path_to_your_file", "r");
if ($handle) {
while (($buffer = fgets($handle, 1024)) !== false) {
doSomethingWithChunk($buffer );
}
fclose($handle);
}
# http://stackoverflow.com/questions/21121037/most-memory-efficient-way-to-split-a-variable-sized-chunks