RE: [PHP] Suggestion for "IN()"
| From: | Jay Blanchard | Date: | Thu, 30 Sep 2004 19:47:34 +0000 |
| Subject: | RE: [PHP] Suggestion for "IN()" | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-198329@lists.php.net to get a copy of this message | ||
[snip]
I'm sure I'll be flamed for this, but it seems to me that there should
be a
shortcut way to write:
If ($a == 1 || $a == 4 || $a == 20 || ...) {}
To something more like what SQL has...
If ( $a IN(1,4,20,...) ) {}
And same with the very helpful SQL BETWEEN 'function'.
Instead of
If ($a > 1 && $a < 20) {}
Why not
If ($a BETWEEN (1,20)) {}
[/snip]
You could write a function and share it with the rest of us!