call_user_func

mixed call_user_func(string function_name, [mixed function_parameter], 
[mixed ...]) 
function_name Function to be called
function_parameter First argument to be passed to function_name
... Additional arguments to be passed to function_name

Alternate method for calling functions.

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() is primarily useful as a way to dynamically call functions and methods at runtime without having to use eval().

Normally, functions are called with the following syntax:

function_name ('arg one', 'arg two', ...); 

Calling the same function using call_user_func() would look ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.