1,获得当前时间
echo date('Y-m-d H:i:s',time());
2,获取客户端IP
echo $_SERVER["REMOTE_ADDR"];
或者是
function get_real_ip(){
$unknown = 'unknown';
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR'])
&& $_SERVER['HTTP_X_FORWARDED_FOR']
&& strcasecmp($_SERVER['HTTP_X_FORWARDED_FOR'],
$unknown) ) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif ( isset($_SERVER['REMOTE_ADDR'])
&& $_SERVER['REMOTE_ADDR'] &&
strcasecmp($_SERVER['REMOTE_ADDR'], $unknown) ) {
$ip = $_SERVER['REMOTE_ADDR'];
}
if (false !== strpos($ip, ','))
$ip = reset(explode(',', $ip));
return $ip;
}
}
3.获得当前的URL