P粉6847208512023-09-05 13:36:23
Thankshareth pyI found the answer!
<?php ini_set('max_execution_time', 0); header('Content-Encoding: none;'); header('Content-type: text/html; charset=utf-8;'); ob_start("ob_gzhandler"); $j = 200; $k = pow(2, 10); echo "One moment please...".str_pad('', $k)."<br />\n<br />\n"; $i = 0; while ($i < $j) { $i++; echo "Test ".$i.str_pad('',$k)."<br />\n"; ob_flush(); usleep(100000); } ?>
I increased $j to 200 and lowered the sleep time to 0.1 seconds. Safari does respond a little slowly, but eventually it displays line by line. Just like Firefox and Chrome.
P粉7624473632023-09-05 09:01:35
edit:
ob_start("ob_gzhandler")
Intended to be used as a callback function for ob_start() to help send gz-encoded data to web browsers that support compressed web pages. source
<?php ini_set('max_execution_time', 0); header('Content-Encoding: none;'); header('Content-type: text/html; charset=utf-8'); ob_start("ob_gzhandler"); $j = 8; $k = pow(2, 10); echo "One moment please...".str_pad('', $k)."<br />\n<br />\n"; $i = 0; while ($i < $j) { $i++; echo "Test ".$i.str_pad('',$k)."<br />\n"; ob_flush(); sleep(1); } ?>
Output (on Chrome):