Home >php教程 >PHP源码 >统计在线人数

统计在线人数

PHP中文网
PHP中文网Original
2016-05-25 17:06:521105browse

跳至

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

                   

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