Hello Brent,
Tuesday, March 16, 2004, 12:39:27 PM, you wrote:
BC> im in desperate need of help for a reg expression to ONLY allow 8
BC> NUMBERS to start with 100 and may not have any other kind of
BC> letters or characters. Only numbers
BC> for example
BC> 10064893
It's not a reg exp, but it will work:
if (is_numeric($val) == FALSE || strlen($val) <> 8 || substr($val, 0,
3) !== "100")
{
// $val doesn't match
}
Conversely:
if (is_numeric($val) == TRUE && strlen($val) == 8 && substr($val, 0,
3) == "100")
{
// $val does match
}
(Code not tested, but you get the idea I hope)
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php