[PHP] alter switch variable inside case?

2002-08-31 Thread Joe Janitor
I'd like to be able to modify the switch variable inside a case statement, like this: switch ($foo) { case 'step2': do_step2(); if ($error) $foo='step1'; //repeat step1 break; case 'step1': do_step1(); break; case 'a_third_thing': do_something_else(); break; } Can

Re: [PHP] alter switch variable inside case?

2002-08-31 Thread Joe Janitor
If you don't break, it continues to execute all the code until the end of the switch, ignoring any subsequent case statements. In my example, eliminating the break after step2 would cause execution of do_step1(), but also do_something_else(), which is not desired. --- @ Edwin [EMAIL PROTECTED]

Re: [PHP] alter switch variable inside case?

2002-08-31 Thread Joe Janitor
Regardless of how many break statements you take away (even if only 1), case statements appear to be ignored after the first match is made. I need a way to make the switch statement continue evaluating case-matches, even after the first case match is made. Further, it should allow one case

Re: [PHP] Re: alter switch variable inside case?

2002-08-31 Thread Joe Janitor
you can. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] [EMAIL PROTECTED] www.GroupAKT.com - Hébergement Group. www.WorldAKT.com - Hébergement de sites Internet Joe Janitor [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL