Home  >  Article  >  php教程  >  PHP设置一边执行一边输出结果的代码

PHP设置一边执行一边输出结果的代码

WBOY
WBOYOriginal
2016-06-13 12:48:10816browse

复制代码 代码如下:


 set_time_limit(10);   
 ob_end_clean();     //在循环输出前,要关闭输出缓冲区  

 echo str_pad('',1024);  
 //浏览器在接受输出一定长度内容之前不会显示缓冲输出,这个长度值 IE是256,火狐是1024  
 for($i=1;$i  echo $i.'
';   
  flush();    //刷新输出缓冲  
  sleep(1);   
 }   
?>

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