php获取id

    private static function getClientIp()
{
if (getenv('HTTP_X_FORWARDED_FOR')) {
$tmp = explode(',', getenv('HTTP_X_FORWARDED_FOR'));
$onlineip = $tmp[0];
} elseif (getenv('HTTP_REMOTEIP')) {
$onlineip = getenv('HTTP_REMOTEIP');
} elseif (getenv('HTTP_CLIENT_IP')) {
$onlineip = getenv('HTTP_CLIENT_IP');
} elseif (getenv('REMOTE_ADDR')) {
$onlineip = getenv('REMOTE_ADDR');
} else {
$onlineip = '127.0.0.1';
} return $onlineip;
}
上一篇:权限设计实现(MVC4+Bootstrap+ PetaPoco+Spring.Net)


下一篇:EF Code First DataAnnotations