PHP shell large output(100+ lines) to browser
<p>I am trying to execute a shell script which will have 100+ lines and which is a dynamic data.
How can i print each line to the browser as shell executes.
Here is the way i am trying but it's not working?</p>

<pre><code>&lt;?php
    ob_start();  
    echo "&lt;pre&gt;";  
    system("/var/www/html/shell_script.sh -e &lt;arg1&gt;");  
    ob_flush();  
    flush();  
?&gt;
</code></pre>

<p>but the below code is working , since i am looping...</p>

<pre><code>&lt;?php
    ob_start();
    for($i=0;$i&lt;40;$i++)
    {
        echo 'printing...&lt;br /&gt;';
        ob_flush();
        flush();
        ob_end_flush();
        usleep(300000);
    }
?&gt;
</code></pre>

<p>Please advice me how to make my shell out put to the browser as it executes.</p>
