> -----Original Message-----
> From: Monty [mailto:[EMAIL PROTECTED]
> Sent: 31 May 2003 21:21
>
> If you want the entire string to be tested for digits, you
> need to add the
> length of the string to the regex pattern:
>
> $length = strlen($data);
> preg_match("[0-9]{$length}", $data);
Or anchor the pattern to both start and end of the string:
preg_match("^[0-9]+$", $data);
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php