RE: [PHP] Only numbers
| From: | Boget, Chris | Date: | Mon, 06 Nov 2000 22:42:34 +0000 |
| Subject: | RE: [PHP] Only numbers | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-23997@lists.php.net to get a copy of this message | ||
> Is there a way that you can make sure a string contains only numbers?
$onlyNumbers = eregi( "^[0-9]+$", $userString );
if( !$onlyNumbers ) {
echo "Sorry, you must enter numbers only!!";
}
Chris