note 29587 deleted from function.ereg by didou
| From: | didou@php.net | Date: | Sun, 07 Dec 2003 03:00:35 +0000 |
| Subject: | note 29587 deleted from function.ereg by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-61558@lists.php.net to get a copy of this message | ||
Note Submitter: krang
----
This is probably really simple, but if anyone wants to validate a variable $COLOUR to ensure is a
valid HEX value, you can use this...
if (ereg ('^#([a-fA-F0-9]){6}$', $COLOUR) == false || strlen($COLOUR) != 7) {
echo "Isn't a valid HEX value";
}