Forum

php, simple ob_star...
 
Powiadomienia
Wyczyść wszystko

php, simple ob_start()

1 Wpisy
1 Użytkownicy
0 Reactions
1,437 Widoki
0
Rozpoczynający temat

refresh site during calculation, process on page

1 odpowiedź
0
Rozpoczynający temat
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();
    }

Twoja odpowiedź

Nazwa autora

E-mail autora

Twoje zapytanie *

 
Podgląd 0 rewizje Zapisano
Udostępnij: