class aClass { public static function directWrite($message) { echo 'this is a static function from aClass !'; echo " "; echo $message; echo " "; } function write($message) { echo 'this is a normal function from aClass !'; echo " "; echo $message; echo " "; } } function test($echo) { echo 'this is a single global function !'; echo $echo, " "; } $params = array("hello world ! all of you "); $param='hello world ! just you '; $method='test'; echo " "; call_user_func_array($method, $params); echo " "; $method($param); echo " "; call_user_func_array(array('aClass', "directWrite"), $params); $obj = new aClass(); $method='write'; echo " "; call_user_func_array(array($obj, $method), $params); echo " "; $obj->{$method}($param);
一切不解释,直接上代码,不明白的概念自己查资料