What if the $_SERVER does not contain the IPv4 ip? – PHP Versions
I am trying to code a PHP script for getting the client's IP address using this function: public function getIpAddress() { $ipAddress = ''; if (! empty($_SERVER['HTTP_CLIENT_IP']) && $this->isValidIpAddress($_SERVER['HTTP_CLIENT_IP'])) { // check for shared ISP IP $ipAddress = $_SERVER['HTTP_CLIENT_IP']; }…