RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Martin Towell
I've been using this: if (in_array($value, array(foo, bar, blah))) { // do something } but if you want to use a switch/case, I don't know any easier way. HTH Martin -Original Message- From: CF High [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2003 1:41 PM To: [EMAIL

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
Check the manual: switch($foo) { case fee: case fie: ... break; case fo: ... case fum: ... break; } fee fie are tied together, fie will also run the code presented by fum ... Even

Re: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Leif K-Brooks
switch($value){ case 'foo': case 'bar': //It's either foo or bar break; } CF High wrote: Hey all. In Cold Fusion I was able to do the following: CFSWITCH expression = #action# CFCASE value = getUpdate,getDelete Do Stuff /CFCASE /CFSWITCH Note the comma

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
Duh. make that fo will also run the code presented by fum ... -Original Message- From: Mark Charette [mailto:[EMAIL PROTECTED] switch($foo) { case fee: case fie: ... break; case fo: ... case fum: