I have a script that echo
out content in a php script and resulting in a very large file, e.g. 100MB
Currently I use the following way to capture the output and write to another file
ob_start();
require_once 'dynamic_data.php'; // echo 100MB data
$data = ob_get_clean();
file_put_contents($path, $data);
Are there any easy way to re-write the above program (better not touching dynamic_data.php
as it is hard to re-factor) so it can stream the output to the file directly without saving the content in the memory?