Re: [PHP] Array instead of Switch

2003-02-22 Thread Markas
"David Otton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 22 Feb 2003 03:28:22 -, you wrote: > > >Let's say I need to take one of 20 actions depending on a form selection. I > >could use a switch statement with 20 cases, but I could also do something > >like: > > > >// Pre

RE: [PHP] Array instead of Switch

2003-02-21 Thread John W. Holmes
> >Let's say I need to take one of 20 actions depending on a form selection. > I > >could use a switch statement with 20 cases, but I could also do something > >like: > > > >// Pretend this comes from a form > >$formchoice = "mars"; > > > > > >$response = array( > > "mars" => "go_mars()", > > "merc

Re: [PHP] Array instead of Switch

2003-02-21 Thread David Otton
On 22 Feb 2003 03:28:22 -, you wrote: >Let's say I need to take one of 20 actions depending on a form selection. I >could use a switch statement with 20 cases, but I could also do something >like: > >// Pretend this comes from a form >$formchoice = "mars"; > > >$response = array( > "mars" =>

Re: [PHP] Array instead of Switch

2003-02-21 Thread David T-G
Chris, et al -- ...and then Chris said... % % Let's say I need to take one of 20 actions depending on a form selection. I % could use a switch statement with 20 cases, but I could also do something % like: % % // Pretend this comes from a form % $formchoice = "mars"; % % % $response = array(