src/TixAstronauta/AccIp/AccIp.php
public function getIpAddress()
    {
        foreach ($this->headers as $k)
        {
            if (isset($this->server[$k]))
            {
                // header can be comma separated
                $ips = explode(',', $this->server[$k]);
                $ip = trim(end($ips));
                $ip = filter_var($ip, FILTER_VALIDATE_IP);
                if (false !== $ip)
                {
                    return $ip;
                }
            }
        }

        // no valid ip found
        return false;
    }
public function getIpAddress()
    {
        foreach ($this->headers as $k)
        {
            if (isset($this->server[$k]))
            {
                // header can be comma separated
                $ips = explode(',', $this->server[$k]);
                $ip = trim(end($ips));
                $ip = filter_var($ip, FILTER_VALIDATE_IP);
                if (false !== $ip)
                {
                    return $ip;
                }
            }
        }

        // no valid ip found
        return false;
    }
public function getIpAddress ( ) { foreach ( $ this -> headers as $ k ) { if ( isset ( $ this -> server [ $ k ] ) ) { // header can be comma separated $ ips = explode ( ',' , $ this -> server [ $ k ] ) ; $ ip = trim ( end ( $ ips ) ) ; $ ip = filter_var ( $ ip , FILTER_VALIDATE_IP ) ; if ( false !== $ ip ) { return $ ip ; } } } // no valid ip found return false ; }
Returns client's accurate IP Address

@return bool|string ip address, false on failure
Returns client s accurate IP Address