Re: Help with matching numbers 0-100
| From: | frank | Date: | Sat, 03 Feb 2007 17:04:44 +0000 |
| Subject: | Re: Help with matching numbers 0-100 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-248241@lists.php.net to get a copy of this message | ||
better make a switch statement: with case such as
switch($x):
case ($x >= 16 && $x <= 30):
break;
case ....
set*
""Chilling Lounge Admin"" <admin@chillinglounge.net> schrieb im
Newsbeitrag
news:a927b2380702030855w1d730547wcb35d813c8b09a4b@mail.gmail.com...
> 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