5
validatecolor
validate_color
SYNOPSIS
validate_color($color, $with_hashmark=true)
DESCRIPTION
CODE
- function validate_color($color, $with_hashmark=true) {
- return preg_match($with_hashmark ? '/^#?([0-9A-F]){6}$/i' : '/^([0-9A-F]){6}$/i', $color);
- }
Comments