统计在线人数
程序员文章站
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 ) . "人在线"; ?>