PHP and Ranges
| From: | Jason Caldwell | Date: | Thu, 19 Apr 2001 22:31:11 +0000 |
| Subject: | PHP and Ranges | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-49440@lists.php.net to get a copy of this message | ||
is there a way to compare a value to a preset range.
for example;
$preset_ range = [0...65535]
$a[0] = "12";
$a[1] = "198";
$a[2] = "B";
$ac = count($a);
for($x=0; $x < $ac; $x++)
{
if($a[$x] != $preset_range)
{
$valid = 0;
}
else
{
valid = 1;
}
print($valid . "\n");
}
output should look like:
1
1
0
how is this accomplished in PHP?
thanks.
jason