public function isValid($type = 'both')
	{
		$type  = strtolower($type);
		$flags = 0;

		if ($type === 'ipv4')
		{
			$flags = FILTER_FLAG_IPV4;
		}
		if ($type === 'ipv6')
		{
			$flags = FILTER_FLAG_IPV6;
		}

		return (bool) filter_var($this->ip, FILTER_VALIDATE_IP, ['flags' => $flags]);
	}
public function isValid($type = 'both')
	{
		$type  = strtolower($type);
		$flags = 0;

		if ($type === 'ipv4')
		{
			$flags = FILTER_FLAG_IPV4;
		}
		if ($type === 'ipv6')
		{
			$flags = FILTER_FLAG_IPV6;
		}

		return (bool) filter_var($this->ip, FILTER_VALIDATE_IP, ['flags' => $flags]);
	}
public function isValid ( $ type = 'both' ) { $ type = strtolower ( $ type ) ; $ flags = 0 ; if ( $ type === 'ipv4' ) { $ flags = FILTER_FLAG_IPV4 ; } if ( $ type === 'ipv6' ) { $ flags = FILTER_FLAG_IPV6 ; } return ( bool ) filter_var ( $ this -> ip , FILTER_VALIDATE_IP , [ 'flags' => $ flags ] ) ; }
Checks to see if the ip address is of valid form

@param   string  $type  The IP Protocol version to validate against
@return  bool
Checks to see if the ip address is of valid form