Re: Suggestion for "IN()"
| From: | Jason Wong | Date: | Thu, 30 Sep 2004 19:49:25 +0000 |
| Subject: | Re: Suggestion for "IN()" | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198332@lists.php.net to get a copy of this message | ||
On Friday 01 October 2004 03:10, Daevid Vincent wrote:
> 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,...) ) {}
in_array() or make your own IN() function.
> And same with the very helpful SQL BETWEEN 'function'.
>
> Instead of
>
> If ($a > 1 && $a < 20) {}
>
> Why not
>
> If ($a BETWEEN (1,20)) {}
Ditto, make your own BETWEEN() function.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Please don't put a strain on our friendship by asking me to do something
for you.
*/