Welcome Guest, Not a member yet? Register   Sign In
CI and flushing output question
#1

[eluser]btray77[/eluser]
I've been trying to do something very simple and I cannot get it to work. I want to flush the output while i've got a process working. I'm going though hundreds of database records and file, and want to display a "*" when I finish each one.

I've looked into :
ob_end_flush();
ob_start();
ob_flush();
flush();

Below is a sample function I made to display the working, progress...

can someone give me working sample of how to display output without getting stuck in the buffer?

Code:
function working( $char = null)
{
    static $counter = 0;
    
    if ($counter > 120) {
        $counter = 0;
        echo '<br/>';
    }
    if (! $char) $char = '*';
    echo $char;
    $counter++;
}

I was guessing something like below, but it doesn't work:

Code:
function go ()
{
    for ($i = 1; $i <= 10; $i++) {
        working('*');
        ob_flush
        flush();
    sleep(10);
}    

go();


Messages In This Thread
CI and flushing output question - by El Forum - 08-31-2009, 02:35 AM
CI and flushing output question - by El Forum - 09-29-2009, 10:38 AM
CI and flushing output question - by El Forum - 09-29-2009, 10:54 AM
CI and flushing output question - by El Forum - 09-29-2009, 05:41 PM
CI and flushing output question - by El Forum - 09-29-2009, 06:23 PM
CI and flushing output question - by El Forum - 09-29-2009, 08:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB