public function validateIpAddress(string $ipAddress) : bool
    {
        if ($ipAddress === '') {
            return false;
        }

        return (bool) filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE);
    }
public function validateIpAddress(string $ipAddress) : bool
    {
        if ($ipAddress === '') {
            return false;
        }

        return (bool) filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE);
    }
public function validateIpAddress ( string $ ipAddress ) : bool { if ( $ ipAddress === '' ) { return false ; } return ( bool ) filter_var ( $ ipAddress , FILTER_VALIDATE_IP , FILTER_FLAG_NO_PRIV_RANGE ) ; }
Checks whether the given string is a valid public IPv4 or IPv6 address

@param string $ipAddress
@return bool
Checks whether the given string is a valid public IPv4 or IPv6 address