5

validatecolor

validate_color
SYNOPSIS

validate_color($color, $with_hashmark=true)

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

Comments

To add a comment, click here.