One way is:
$min = 0;
$max = 65535;
if ($var >= $min && $var <= $max)
{
...
}
Though I haven't heard of a range comparison, it would be nice if one
existed...especially if it could be something like "0-4, 6-8, 9-21", and it
would return true of the value was within any of the specified ran
I can do it, it aint pretty though
$val)
if (in_array($val, $range))
echo "True ";
else
echo "False ";
?>
works, just aint pretty.
--
Chris Lee
[EMAIL PROTECTED]
""Jason Caldwell"" <[EMAIL PROTECTED]> wrote in message
9bnos3$flm$[EMAIL PROTECTED]">news:9bnos3$flm$[EMAIL PR
this works:
$r_start = 0;
$r_end = 65535;
$a = array('12', '198', 'b');
while ( list($k,$v) = each($a) ) {
if ( ($v > $r_start) && ($v < $r_end) ) {
print "[$v] OK\n";
}
else {
print "[$v] NOPE\n";
}
}
> -Original Messag
3 matches
Mail list logo