added a mac validation method.
This commit is contained in:
parent
430efe8978
commit
98fee3a0e0
12
Validate.php
12
Validate.php
|
@ -59,7 +59,7 @@ class Validate
|
|||
* @param string $address IP address
|
||||
* @return bool is the IP Address valid?
|
||||
*/
|
||||
static function ip(string $address) : bool
|
||||
static function ip (string $address) : bool
|
||||
{
|
||||
return false !== filter_var($address, FILTER_VALIDATE_IP);
|
||||
}
|
||||
|
@ -84,6 +84,16 @@ class Validate
|
|||
return false !== filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function for validation a Mac Address.
|
||||
* @param string $address mac address
|
||||
* @return bool is the mac valid?
|
||||
*/
|
||||
static function mac (string $address) : bool
|
||||
{
|
||||
return false !== filter_var($address, FILTER_VALIDATE_MAC);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function for validating a number range.
|
||||
* @param float $value number to validate
|
||||
|
|
Loading…
Reference in New Issue