note 29587 added to function.ereg

From: Date: Tue, 18 Feb 2003 12:20:34 +0000
Subject: note 29587 added to function.ereg
Groups: php.notes 
Request: Send a blank email to php-notes+get-44145@lists.php.net to get a copy of this message
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"; } -- http://www.php.net/manual/en/function.ereg.php http://master.php.net/manage/user-notes.php?action=edit+29587 http://master.php.net/manage/user-notes.php?action=delete+29587 http://master.php.net/manage/user-notes.php?action=reject+29587

« previous php.notes (#44145) next »