[PHP] dynamic case statements?

2006-08-18 Thread Tom Cruickshank
Hello, Would anyone know if it's possible to have dynamic case statements? For example. Theform = new form(); $temp = $_POST['var1']; switch ($temp) { case "status": $theform->status(); break; case $temp: $theform->form($temp);

Re: [PHP] dynamic case statements?

2006-08-19 Thread Richard Lynch
On Fri, August 18, 2006 11:58 am, Tom Cruickshank wrote: > Would anyone know if it's possible to have dynamic case > statements? Almost for sure... I *know* you can use switch(true) and put *ANY* expression you want for a case. switch (true) { case $temp === 'status': $theform->status(