I'm trying to make a system call and have each line sent to the browser in real time
echo('<pre>');
system('ping -c 10 www.google.com');
echo('</pre>);
This works when I call it from the command line (each line of the ping is output one at a time). However it does not work when I try to open with a browser (firefox or chrome).
I am almost certain this has something to do with the output buffering enforced by the browser. They will not display new data unless it is above a cetrain threshold. Solutions to these kind of problems typically involve outputting a bunch of blank characters, ie str_repeat(' ',1024*64)
. Can you think of any way to get the browser to display the output in real time?