欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

统计在线人数

程序员文章站 2024-01-02 10:47:52
...
跳至
 time ())) {
		array_push ( $temp, $user [0] . "," . $user [1] );
	}
}
array_push ( $temp, getip () . "," . (time () + ($timeout)) . '#' );
$user_arr = implode ( "#", $temp );
$fp = fopen ( $user_online, "w" );
flock ( $fp, LOCK_EX );
fputs ( $fp, $user_arr );
flock ( $fp, LOCK_UN );
fclose ( $fp );
echo "当前有" . count ( $temp ) . "人在线";
?>

相关标签: 统计在线人数

上一篇:

下一篇: