Home  >  Article  >  Backend Development  >  PHP循环中进度展示以及"假死"

PHP循环中进度展示以及"假死"

WBOY
WBOYOriginal
2016-06-13 12:34:371222browse

PHP循环中进度显示以及"假死"
理论上程序应该运行完500次然后才显示成功,但是基本只能运行个十来次页面就开始全白(同时网页中载入的标志也消失了),就不再往下继续执行程序了
求助这种问题应该如何解决,谢谢

另外,进度方面不知道应该如何处理。再次感谢


<?PHP<br />
for ($i=1;$i<500;$i++){<br />
	file_put_contents("{i}.txt",$i);<br />
	sleep(3);<br />
	$s = $i/100;<br />
	if($s==ceil($s)) {<br />
		$s = $i/500;<br />
		echo "进度:{$s}<BR>";<br />
		}<br />
}<br />
echo "OK";<br />
?>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn