WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0
Call a user defined function with optional parameters
Return result as defined by the user function
$function_name: String containing the name of the user function to call
$parameters: Optional parameter(s) to pass to the function
Mixed: Any type depending on the way the function is defined
<? function my_add($x,$y) { return $x+$y; } $result=call_user_func("my_add",1,3); print($result); // result is 4 ?>
function_exists() - Check if a function exists (native or custom)
function - Define a function
return - Return program control to the calling module
User defined functions can take many different forms, and it is not necessary to use call_user_func() to execute a function unless a direct return value is needed.
If used within a function, the return statement immediately ends execution of the function, and returns its argument as the value of the function call.