PHP implementation of statistics on the number of web site online, PHP online number of people
In this paper, we describe how PHP implements the number of online statistics websites. Share to everyone for your reference. The implementation method is as follows:
$val) { $val = trim ($val); if ($val! = "") { list ($when, $seti) = explode ("\ t", $val); if ($seti = = $ip) { $arr [$key] = $time. "\ T". $seti; $flag = 1; } else { $currentTime = time (); if ($currentTime-$when >) { unset ($arr [$key]); } else{ $arr [$key]= $val; } }} if ($flag = = 0) { array_push ($arr, $time. "\ T". $IP); } $count = count ($arr), $str = Implode ("\ r \ n", $arr); $str. = "\ r \ n"; Writeover ($fileCount, $str, ' W ', 0); unset ($arr); } return $count;} $time = Time (), $ip = Getipaddress (); $online _num = Count_online_num ($time, $IP); Echo $online _num;? >
The above is the PHP implementation of statistics website online number of methods, PHP online number _php tutorial content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!
http://www.bkjia.com/PHPjc/998558.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/998558. Htmltecharticlephp the way to achieve statistics on the number of people online, PHP online This example describes how PHP implements the number of online statistics websites. Share to everyone for your reference. The concrete implementation method is as follows ...