<?php
class online{
	/*获取用户IP函数*/
	function user_ip(){
		if ($_SERVER["HTTP_X_FORWARDED_FOR"]) { 
			$ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; 
		}elseif($_SERVER["HTTP_CLIENT_IP"]){ 
			$ip = $_SERVER["HTTP_CLIENT_IP"]; 
		}elseif($_SERVER["REMOTE_ADDR"]){ 
			$ip = $_SERVER["REMOTE_ADDR"]; 
		}elseif(getenv("HTTP_X_FORWARDED_FOR")){ 
			$ip = getenv("HTTP_X_FORWARDED_FOR"); 
		}elseif(getenv("HTTP_CLIENT_IP")){ 
			$ip = getenv("HTTP_CLIENT_IP"); 
		}elseif(getenv("REMOTE_ADDR")){ 
			$ip = getenv("REMOTE_ADDR"); 
		}else{ 
			$ip = "Unknown"; 
		}	 
		return $ip;
	}
	
	//今天0时0分的时间戳
	$todayTime = mktime(0,0,0,date('m'),date('d'),date('Y'));
	
	//本月1日0时0分时间戳
	$monthTime = mktime(0,0,0,date('m'),1,date('Y'));
	}