ob_start()无效,怎么解决
ob_start();
for($i=0; $i
for ($i=10; $i>0; $i--)
{
echo $i;
flush();
sleep(1);
}
?>
不能间隔1秒输出,而是一起输出,乍解决??
------解决方案--------------------
你可以这样试一试,也许可以
ob_start(); ob_end_flush(); for($i = 1; $i <font color="#e78608">------解决方案--------------------</font><br>这样写
for ($i=10; $i>0; $i--)
{
echo $i . str_repeat(' ', 256);
flush();
ob_flush();
sleep(1);
}
<br><font color="#e78608">------解决方案--------------------</font><br><?php <br />ob_start();<br>echo str_repeat(' ', 4096); //不到这个数,不会发往客户端<br>flush();<br>for($i=0; $i<br>for ($i=10; $i>0; $i--)<br>{<br> echo $i;<br> flush();<br> sleep(1); <br>}<br>?><br><div class="clear"></div>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号