RE: [PHP] Only numbers
| From: | Maxim Maletsky | Date: | Tue, 07 Nov 2000 01:52:54 +0000 |
| Subject: | RE: [PHP] Only numbers | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-24034@lists.php.net to get a copy of this message | ||
a better way is is_int()
but with RegEx you can do a simple
$n = ereg( "^[[:digit:]]$", $String );
if($n) echo 'Numbers Only Tested Successfully!';
Cheers!
-----Original Message-----
From: Liam Gibbs [mailto:lgibbs@microlegend.com]
Sent: Tuesday, November 07, 2000 8:50 AM
To: php-general@lists.php.net
Subject: RE: [PHP] Only numbers
Whoa. Thanks for the quick response, guys! eregi worked fine. I didn't user
is_int() or is_integer() because it seems they only check if your variable
is of integer or int class, not if it contains only numbers.
Liam Gibbs
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net