Home > Backend Development > PHP Tutorial > PHP设置一边执行一边输出结果的代码_PHP

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

WBOY
Release: 2016-06-01 11:59:20
Original
1045 people have browsed it
复制代码 代码如下:
 set_time_limit(10);   
 ob_end_clean();     //在循环输出前,要关闭输出缓冲区  

 echo str_pad('',1024);  
 //浏览器在接受输出一定长度内容之前不会显示缓冲输出,这个长度值 IE是256,火狐是1024  
 for($i=1;$i  echo $i.'
';   
  flush();    //刷新输出缓冲  
  sleep(1);   
 }   
?>
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template