getHeaders(); if(isset($headers['x-forwarded-for'][0]) && !empty($headers['x-forwarded-for'][0])) { $ips = explode(',', $headers['x-forwarded-for'][0]); return trim($ips[0]); } elseif (isset($headers['x-real-ip'][0]) && !empty($headers['x-real-ip'][0])) { return $headers['x-real-ip'][0]; } $serverParams = $request->getServerParams(); return $serverParams['remote_addr'] ?? ''; } } if (!function_exists('getRoutePrefix')) { function getRoutePrefix() { return env('ROUTE_PREFIX', '/newSns'); } }