设为首页收藏本站language→→ 语言切换

鸿鹄论坛

 找回密码
 论坛注册

QQ登录

先注册再绑定QQ

查看: 2655|回复: 0
收起左侧

用php实现边执行边输出的效果

[复制链接]
发表于 2010-2-24 13:43:51 | 显示全部楼层 |阅读模式
<OL><LI><CODE><FONT face=新宋体>&lt;?php</FONT></CODE><LI><LI><CODE><FONT face=新宋体>/*</FONT></CODE><LI><CODE><FONT face=新宋体>@author:axgle &lt;axgle at 126 dot com&gt;</FONT></CODE><LI><LI><CODE><FONT face=新宋体>@note:要决是在每次flush显示前,输出str_pad("",10000)</FONT></CODE><LI><LI><CODE><FONT face=新宋体>@why:为什么非要10000?呵呵,大于10000也可以,我测试出来的</FONT></CODE><LI><LI><CODE><FONT face=新宋体>*/</FONT></CODE><LI><LI><CODE><FONT face=新宋体>print "一共5个档案要处理&lt;hr&gt;";</FONT></CODE><LI><CODE><A href="http://www.php.net/manual/zh/function.sleep"><FONT face=新宋体 color=#0000ff><U>sleep</U></FONT></A><FONT face=新宋体>(1);</FONT></CODE><LI><LI><CODE><FONT face=新宋体>print <A href="http://www.php.net/manual/zh/function.str_pad"><U><FONT color=#0000ff>str_pad</FONT></U></A>("",100000);</FONT></CODE><LI><CODE><A href="http://www.php.net/manual/zh/function.flush"><FONT face=新宋体 color=#0000ff><U>flush</U></FONT></A><FONT face=新宋体>();</FONT></CODE><LI><LI><CODE><FONT face=新宋体>for($i=1;$i&lt;=5;$i++)</FONT></CODE><LI><LI><CODE><FONT face=新宋体>{ </FONT></CODE><LI><LI><CODE><A href="http://www.php.net/manual/zh/function.sleep"><FONT face=新宋体 color=#0000ff><U>sleep</U></FONT></A><FONT face=新宋体>(1);</FONT></CODE><LI><LI><CODE><FONT face=新宋体>print  "#$i 完毕&lt;hr&gt;";</FONT></CODE><LI><LI><CODE><FONT face=新宋体>print <A href="http://www.php.net/manual/zh/function.str_pad"><U><FONT color=#0000ff>str_pad</FONT></U></A>("",10000);</FONT></CODE><LI><CODE><A href="http://www.php.net/manual/zh/function.flush"><FONT face=新宋体 color=#0000ff><U>flush</U></FONT></A><FONT face=新宋体>();</FONT></CODE><LI><LI><CODE><FONT face=新宋体>}</FONT></CODE><LI><LI><CODE><FONT face=新宋体>print "恭喜,全部处理成功!";</FONT></CODE><LI><LI><CODE><FONT face=新宋体>?&gt;</FONT></CODE></LI></OL>
您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2024-4-25 11:37 , Processed in 0.056571 second(s), 9 queries , Redis On.  

  Powered by Discuz!

  © 2001-2024 HH010.COM

快速回复 返回顶部 返回列表