Help with matching numbers 0-100
| From: | Chilling Lounge Admin | Date: | Sat, 03 Feb 2007 16:55:19 +0000 |
| Subject: | Help with matching numbers 0-100 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-248239@lists.php.net to get a copy of this message | ||
Hi.
I need help with matching a variable. The variable would be e.g. 0-15
, 16-30 etc. and when the variable is equal to a certain range, it
would echo an image.
Does anyone know what function I should use? preg_match?
The code would be something like
if(preg_match("[16-30]",$variable))
{
echo "image";
}
but the above code doesn't work. How do I fix it?
Thanx