Right now in order to see the results, I have to wait until the entire code is done executing. It hangs until it\'s complete and stays loading. Once it\'s finished it shows
You can use output buffering like this:
ob_start(); echo('doing something...'); // send to browser ob_flush(); // ... do long running stuff echo('still going...'); ob_flush(); echo('done.'); ob_end_flush();