Output buffer based progress bar
<p>I have been trying to get the following code working.</p>

<p>It's a progress bar trick which uses ob_get_clean() function.</p>

<p>Don't know why but this script just don't work!</p>

<p>Only the initial percent - 1% comes up and nothing after that.</p>

<pre><code>&lt;?php  
error_reporting(8191);  
function flush_buffers(){  
    @ob_end_flush();  
    @ob_flush();  
    @flush();  
    @ob_start();
} 
$ini    =   2;
echo '&lt;script&gt;document.getElementById(\'lpt\').style.width=\'1%\';&lt;/script&gt;&lt;br&gt;';  
for($i=1;$i&lt;=100;$i++)  {
            $k=$ini-1;
            $str=str_replace("width=\'$k%\'","width=\'$i%\'",ob_get_clean());           
            $ini++;
            echo $str;
            flush_buffers();
}

?&gt;
</code></pre>

<p>

</p>
