Home > Backend Development > PHP Tutorial > php comet 推送解决办法

php comet 推送解决办法

WBOY
Release: 2016-06-13 12:39:12
Original
918 people have browsed it

php comet 推送

set_time_limit(0);<br />
ob_start();<br />
$pad = str_repeat(' ',4000);<br />
echo $pad,'<br />';<br />
ob_flush();<br />
flush();  // 把产生的内容 立即送给浏览器而不要等脚本结束再一起送.<br />
<br />
$i=1;<br />
while($i++) {<br />
    echo $pad,'<br />';<br />
    echo $i,'<br />';<br />
    ob_flush();<br />
    flush();  // 把产生的内容 立即送给浏览器而不要等脚本结束再一起送.<br />
    sleep(1);<br />
}<br />
Copy after login

这段代码是网上复制的,代码没问题,为什么在我wamp 无法实现呢?是否需要配置 apahce 或者 php.ini

php comet
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