workman,events.php中怎么获取服务端IP

yuan521

已经测试 $_SERVER['SERVER_ADDR'] 不可用

1371 1 1
1个回答

Tinywan

以下为使用阿里云SLB获取

$_SESSION['client_ip'] =  $data['server']['HTTP_X_FORWARDED_FOR'] ?? $data['server']['HTTP_REMOTEIP'] ?? '127.0.0.1';
年代过于久远,无法发表回答
×
🔝