note 92440 modified in control-structures.switch by danbrown
| From: | danbrown@php.net | Date: | Fri, 24 Jul 2009 12:47:16 +0000 |
| Subject: | note 92440 modified in control-structures.switch by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-158685@lists.php.net to get a copy of this message | ||
You may also call different functions within switch as per the action you get on the page.
<?php
switch($_POST['action']) {
case 'sum':
execSum();
break;
case 'sub':
execSub();
break;
case 'mul':
execMul();
break;
default:
defaultAction();
break;
}
?>
--was--
You may also call different functions within switch as per the action you get on the page.
switch($_POST['action']) {
case 'sum':
execSum();
break;
case 'sub':
execSub();
break;
case 'mul':
execMul();
break;
default:
defaultAction();
break;
}
http://php.net/manual/en/control-structures.switch.php