Skip to content

Instantly share code, notes, and snippets.

@retrospectacus
Created October 19, 2020 19:12
Show Gist options
  • Save retrospectacus/467083aa3b8e89fcf2debd5c0ebb8641 to your computer and use it in GitHub Desktop.
Save retrospectacus/467083aa3b8e89fcf2debd5c0ebb8641 to your computer and use it in GitHub Desktop.
<?php
function do_not_change_this_function() {
echo "Something is happening\n";
echo "this is important data\n";
ob_flush();
echo "Here is some more data\n";
}
echo "running the program...\n";
ob_start();
ob_start();
do_not_change_this_function();
$output = ob_get_clean();
echo "Program is done, this is its output, let's put it in the database. All lines here and above are lost!\n";
echo $output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment