src/Common/Service/Input.php
public static function isValidIp($sIp, $sType = null)
    {
        switch (strtoupper($sType)) {
            case 'IPV4':
                return filter_var($sIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
                break;
            case 'IPV6':
                return filter_var($sIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
                break;
            default:
                return filter_var($sIp, FILTER_VALIDATE_IP);
                break;
        }
    }
public static function isValidIp($sIp, $sType = null)
    {
        switch (strtoupper($sType)) {
            case 'IPV4':
                return filter_var($sIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
                break;
            case 'IPV6':
                return filter_var($sIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
                break;
            default:
                return filter_var($sIp, FILTER_VALIDATE_IP);
                break;
        }
    }
public static function isValidIp ( $ sIp , $ sType = null ) { switch ( strtoupper ( $ sType ) ) { case 'IPV4' : return filter_var ( $ sIp , FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 ) ; break ; case 'IPV6' : return filter_var ( $ sIp , FILTER_VALIDATE_IP , FILTER_FLAG_IPV6 ) ; break ; default : return filter_var ( $ sIp , FILTER_VALIDATE_IP ) ; break ; } }
Validate an IP address

@param string $sIp   The IP to validate
@param string $sType The type of IP (IPV4 or IPV6)

@return mixed
Validate an IP address