用php实现边执行边输出的效果
<OL><LI><CODE><FONT face=新宋体><?php</FONT></CODE><LI><LI><CODE><FONT face=新宋体>/*</FONT></CODE><LI><CODE><FONT face=新宋体>@author:axgle <axgle at 126 dot com></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个档案要处理<hr>";</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<=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 完毕<hr>";</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=新宋体>?></FONT></CODE></LI></OL>
页:
[1]