note 110306 added to control-structures.switch

From: Date: Tue, 09 Oct 2012 17:16:29 +0000
Subject: note 110306 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-191212@lists.php.net to get a copy of this message
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)); } ?> ---- Server IP: 69.147.83.199 Probable Submitter: 77.253.9.144 ---- Manual Page -- http://www.php.net/manual/en/control-structures.switch.php Edit -- https://master.php.net/note/edit/110306 Del: integrated -- https://master.php.net/note/delete/110306/integrated Del: useless -- https://master.php.net/note/delete/110306/useless Del: bad code -- https://master.php.net/note/delete/110306/bad+code Del: spam -- https://master.php.net/note/delete/110306/spam Del: non-english -- https://master.php.net/note/delete/110306/non-english Del: in docs -- https://master.php.net/note/delete/110306/in+docs Del: other reasons-- https://master.php.net/note/delete/110306 Reject -- https://master.php.net/note/reject/110306 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#191212) next »