Re: [PHP] Two cases going to same case?

2002-06-30 Thread Steve Edberg
At 5:18 AM -0400 6/30/02, Leif K-Brooks wrote: I have a switch in a script I'm working on. I need to have case 1 and 2 both to to case 3, but without case 1 going through case 2. Is this possible? No, but you can do it this way: switch ($foo) { case 1: ... do_something();

Re: [PHP] Two cases going to same case?

2002-06-30 Thread Tom Rogers
Hi One way to achieve the same effect: fallthru = 0; switch($whatever){ case 1: do something1; $fallthru = 1; case 2: if(!$fallthrough){ do something2; } case 3

Re: [PHP] Two cases going to same case?

2002-06-30 Thread Chris Shiflett
Leif K-Brooks wrote: I have a switch in a script I'm working on. I need to have case 1 and 2 both to to case 3, but without case 1 going through case 2. Is this possible? Does case 3 have to be in the switch? If not, just leave it to execute just after the end of the switch.