首页  >  文章  >  php教程  >  统计在线人数

统计在线人数

PHP中文网
PHP中文网原创
2016-05-25 17:06:521091浏览

跳至

 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 ) . "人在线";
?>

                   

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn