Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Action
- {
- public function method1($arg)
- {
- echo 'method1:'.$arg;
- }
- public function method2($arg)
- {
- echo 'method2:'.$arg;
- }
- }
- $act = new Action();
- if (isset($_REQUEST['method']) && method_exists($act, $_REQUEST['method']))
- {
- $act->{$_REQUEST['method']}('value');
- }
Add Comment
Please, Sign In to add comment