Class IpValidator
IP Validator Validates IPv4 and IPv6 address
-
Modulework\Modules\Http\Utilities\IpValidator
implements
Modulework\Modules\Http\Utilities\IpValidatorInterface
Methods summary
public static
boolean
|
#
all( string $ip )
Checks if it is a valid IPv4 or IPv6 address Private, reserved and broadcast
addresses will return false.
Checks if it is a valid IPv4 or IPv6 address Private, reserved and broadcast
addresses will return false.
Parameters
- $ip
string $ip The IP to check
Returns
boolean Whether it is a valid IP address
Implementation of
|
public static
boolean
|
#
ipv4( string $ip )
Checks if the given string is valid IPv4 address
Checks if the given string is valid IPv4 address
Parameters
Returns
boolean Whether it is a valid IPv4 address
Implementation of
|
public static
boolean
|
#
ipv6( string $ip )
Checks if the given string is valid IPv6 address
Checks if the given string is valid IPv6 address
Parameters
Returns
boolean Whether it is a valid IPv6 address
Implementation of
|
public static
boolean
|
#
isPrivate( string $ip )
Checks if the given string is a private IP address (in private range (RFC
1918))
Checks if the given string is a private IP address (in private range (RFC
1918))
Parameters
Returns
boolean TRUE if the IP is a private address
Implementation of
|
public static
boolean
|
#
isReserved( string $ip )
Checks if the given string is a reserved IP address (in reserved range)
Checks if the given string is a reserved IP address (in reserved range)
Parameters
Returns
boolean TRUE if the IP is a reserved IP address
Implementation of
|
public static
boolean
|
#
isBroadcast( string $ip )
Checks if the given string is a broadcast IP address e.g. 0.0.0.0
Checks if the given string is a broadcast IP address e.g. 0.0.0.0
Parameters
Returns
boolean TRUE if the IP is a broadcast address | FALSE if not a valid IP
Implementation of
|
Magic methods summary