note 110306 deleted from control-structures.switch by danbrown
| From: | danbrown@php.net | Date: | Wed, 17 Oct 2012 21:23:20 +0000 |
| Subject: | note 110306 deleted from control-structures.switch by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191385@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
to 2mareks (at) gmail (dot) com 29-Nov-2006 07:03:
Here is my attempt on on this topic. It's much simpler and more legible:
<?php
class actions {
static function welcome() {
print 'hello i\'m php script';
}
static function add() {
// action code
}
static function delete() {
// action code
}
}
extract($_GET);
if (isset($action) && method_exists('actions', $action)) {
call_user_func(array('actions', $action));
}
?>