I have a PHP file that scrapes pages and provides output. However, because scraping sometimes takes a little bit of time, the page takes a while to load. How could I print the contents of a page as it is loaded? For instance, load the first page and print, then load the second page and print, etc. I understand PHP prints everything out after all pages have been loaded. Would AJAX be the best route? If so, where would I start? I am unable to load the pages one by one in separate files, as the URLs are being pulled from one source.
Help would be appreciated!
This is not the same question - I tried the accepted answer and that didn't change a thing. Could it be because I'm using a foreach loop?