What I need to do is a comparison to see if a variable equals none of
the 48 contiguous United States, but as efficiently as possible.
The best way I can come up with the the textbook method of :
if (($state != "AR") && ($state != "AK") && ($state != "AL") &&
($state != "CO") ...etc ) {
Is there some way to shorten that a bit to do:
if ($state != "AR" && "AK" && "AL" && ...etc ) {
I looked at php.net for logical operators but couldn't find anything
that seemed to apply.
If someone can just tell me the keyword to look up in php.net I'd
appreciate it.
Like "search 'foobar', newbie" would be fine. =)
Thanks!!
Liam
the 48 contiguous United States, but as efficiently as possible.
The best way I can come up with the the textbook method of :
if (($state != "AR") && ($state != "AK") && ($state != "AL") &&
($state != "CO") ...etc ) {
Is there some way to shorten that a bit to do:
if ($state != "AR" && "AK" && "AL" && ...etc ) {
I looked at php.net for logical operators but couldn't find anything
that seemed to apply.
If someone can just tell me the keyword to look up in php.net I'd
appreciate it.
Like "search 'foobar', newbie" would be fine. =)
Thanks!!
Liam
Comment