10-23-2007, 01:04 AM
|
#8 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
On the topic of validating the hexadecimal colour string, if you don't care too much about wasted ten-thousands of a second, you could simply use:
PHP Code:
function is_colour($hex)
{
return (bool) preg_match('/^#?[a-fA-F0-9]{6}$/', $hex);
}
|
|
|
|