diff --git a/Validate.php b/Validate.php index 88ee4a8..36e3956 100644 --- a/Validate.php +++ b/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