RE: [PHP] Probably an easy one
| From: | Boget, Chris | Date: | Mon, 08 Jan 2001 18:20:10 +0000 |
| Subject: | RE: [PHP] Probably an easy one | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-33276@lists.php.net to get a copy of this message | ||
> I want to take a variable and make sure it has only the
> characters 1-9 in it. anyone want to give me an example.
if( ereg( "^[0-9]$+", $yourVar )) {
echo "All numbers, only numbers";
} else {
echo "Not all numbers!";
}
Chris