if ($foo >=2 && $foo <=9)

or

preg_match("/[2-9]/gi",$foo);


Alexei's answer will only match the whole numbers 2,3,4,5,6,7,8,9 not
3.8354856868 etc

On Jan 16, 12:45 pm, Alexei Tenitski <[email protected]> wrote:
> if (in_array(4,range(2,9)))
>
> On 16/01/2009 12:42, Michael wrote:
>
> > What is the easiest way I can express an "if equals to numbers 2-9"?
>
> > Michael
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to