get_defined_functions()
This function will give you an array full of all the functions that are available to the script where it was called.
It will be a multidimensional array. The first key ‘internal’ will have all the functions PHP gives you (plus those from extensions). The second key ‘user’ will have any user defined functions. Anything created with create_function() will not appear in the result.
The ‘internal’ list will be quite large (do your own test there and see what your PHP instal gives you). If there are no user defined functions in the script or in the included files (if any), the ‘user’ key will exist but that array will be empty.
$list = get_defined_functions(); var_export($list['user']); // array()
Below you can see that the function does not need to be defined before calling get_defined_functions() and this is because the functions are loaded into the system before runtime.
$list = get_defined_functions(); function print_monkey() { echo ':(|)'; } var_export($list['user']); /* array ( 0 => 'print_monkey', ) */
