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; }