在wamp服务器中,除非使用以下函数,否则我无法刷新输出缓冲区:
ob_end_flush();
ob_flush();
flush();
ob_start();
为什么我需要使用所有这些功能?为什么简单的ob_flush()
不起作用?我的代码:
<?php
ob_start();
header( 'Content-type: text/html; charset=utf-8' );
echo 'Begin ...<br />';
for( $i = 0 ; $i < 6 ; $i++ )
{
echo $i . '<br />';
sleep(1);
ob_end_flush();
ob_flush();
flush();
ob_start();
}
echo 'End ...<br />';
?>
因为在上默认有参数output_braining=
转到C:''wamp''bin''php''php5.4.3''php.ini
找到线路
输出缓冲=打开
并将其更改为
;output_braining=打开