Would like to do if ($a in (1, 2, 3, 4)) or something

From: Date: Sat, 14 Oct 2000 18:16:43 +0000
Subject: Would like to do if ($a in (1, 2, 3, 4)) or something
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-20159@lists.php.net to get a copy of this message
In SQL, you can do things like: ...where field1 in (1, 2, 3, 4) does PHP have an equivalent? The only thing I can think of, a bit of a hack, is: if (in_array($a, array(1, 2, 3, 4))) { but that seems a little kludgey for something like this. Is there a simpler way? | Matt Waggoner - mattw@getacard.com | Software Engineer, Getacard.com, Inc.

« previous php.general (#20159) next »