Forum

php, simple ob_star...
 
Notifications
Clear all

php, simple ob_start()

1 Posty
1 Users
0 Reactions
1,300 Widok
0
Topic starter

refresh site during calculation, process on page

1 Answer
0
Topic starter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
   function simple_ob_start()
   {
        ini_set("zlib.output_compression", 0); 
        ini_set("implicit_flush", 1);  
        if (ob_get_level() == 0) ob_start();
 
        echo "Starting live process...";
 
        for ($i = 1; $i<100; $i++) 
        {
            echo "current step $i of 100";
            echo str_pad('',4096)."n";
            ob_flush();
            flush();
            sleep(2);
        }
        echo "Done.";
        ob_end_flush();
    }
   function simple_ob_start()
   {
        ini_set("zlib.output_compression", 0); 
        ini_set("implicit_flush", 1);  
        if (ob_get_level() == 0) ob_start();

        echo "Starting live process...";

		for ($i = 1; $i<100; $i++) 
		{
			echo "current step $i of 100";
		    echo str_pad('',4096)."n";
            ob_flush();
            flush();
            sleep(2);
		}
        echo "Done.";
        ob_end_flush();
    }

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: