Home >Backend Development >PHP Tutorial >消息持续发送的完整例子,类似socket的那种效果!_PHP

消息持续发送的完整例子,类似socket的那种效果!_PHP

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 12:35:10861browse

例子 http://www.php2000.com/test/testflush.php
应用 我的聊天室就是用这个技术实现持续信息发送的。

测试过的环境
win2000/IIS
linux/apache

win2000 下的 apache 没有成功!不知道为什么!!!



echo "你会看到这个技术的前景!哈哈!...什么?没看到,刷新一次看看!! 看到了吧!!";
$i = 1;
for($j=0;$j
for($i; $i print("\n
$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