-
-
function debug($var, $val) - {
- echo "***DEBUGGINGnVARIABLE: $varnVALUE:";
- if (is_array($val) || is_object ($val) || is_resource($val)) {
- print_r($val);
- } else {
- echo "n$valn";
- }
- echo "***n";
- }
$c = mysql_connect();
- $host = $_SERVER["SERVER_NAME"];
call_user_func_array('debug', array("host", $host)) ;
- call_user_func_array('debug', array("c", $c));
- call_user_func_array('debug', array("_POST", $_POST));
- ?>
-
Copy code
-
-
- function test($str) {
- echo $str;
- }
call_user_func_array("test" ,"NO.1 www.chhua.com");//Output "NO.1 www.chhua.com"
- //Parameter description "The first parameter is the function name, the second is the parameter
- class testClass {
- public function write($str){
- echo $str;
- }
- }
- call_user_func_array(array(testClass,write),"NO.1 www.chhua.com");//When calling with a class, use array (), array (class name, method name)
- ?>
-
Copy code
|