|
Posted by Michael Fesser on 12/20/06 16:44
..oO(KoopaJah)
>A simple possibility could be to declare an array with all the values
>that $a cannot take and use the in_array() function. Something like this:
>
>$forbiddenValues = array(1,2,3,4,17,30);
>if (in_array($a, $forbiddenValues ))
>{
> // some code
>}
>
>But it does not allow you to define something like "all values between 1
>and 4".
if (in_array($a, range(1, 4))) {
...
}
Micha
Navigation:
[Reply to this message]
|