call_user_func_array - Function
Name:
———
call_user_func_array — Alternate method for calling functions.
Synopsis:
————-
mixed call_user_func_array(function_name[, argument_array]);
string function_name: Function to be called
array argument_array (optional): Array of arguments to be passed to function_name
Returns:
————
Return value of function_name; if function_name is not a valid function name, the function generates a warning and no value is returned.
Description:
—————-
call_user_func_array() is primarily useful as a way to dynamically call functions and methods at runtime without having to use eval() . call_user_func_array() passes the elements in argument_array to function_name as an argument list. This makes it easy to pass an unknown number of arguments to a function.
Example:
————-
Normally, functions are called with the following syntax:
function1 (’arg1′, ‘arg2′, …);
Calling the same function using call_user_func_array() would look like this:
call_user_func_array (’function1′, array (’arg1 ‘, ‘arg2′, …));
