This article describes the function is actually a PHP manual, but because these functions are strong independence, find not easy, so a separate introduction, convenient access.
1. Get all available modules-get_loaded_extensions This function returns all the (available) modules that have been loaded.
Usage:
Copy Code code as follows:
Print_r (Get_loaded_extensions ());
2. Get the available functions for the specified module-Get_extension_funcs This function returns all available functions for the specified module. Parameters passed in (module name) must be lowercase
Usage:
Copy Code code as follows:
Print_r (Get_extension_funcs ("GD"));
3. Get all the defined functions-get_defined_functions This function returns all the functions that have been defined, including built-in functions and user-defined functions.
Usage:
Copy Code code as follows:
function Myrow ($id, $data) {
Return "<tr><th> $id </th><td> $data </td></tr>\n";
}
$arr = Get_defined_functions ();
Print_r ($arr);
Output:
Copy Code code as follows:
Array
(
[Internal] => Array
(
[0] => zend_version
[1] => Func_num_args
[2] => Func_get_arg
[3] => Func_get_args
[4] => strlen
[5] => strcmp
[6] => strncmp
...
[750] => Bcscale
[751] => Bccomp
)
[User] => Array
(
[0] => Myrow
)
)
where $arr ["internal"] is a built-in function, $arr ["User"] is a user-defined function.
4. Check that the specified function exists-function_exists The function returns whether the specified function has been defined.
Usage:
Copy Code code as follows:
if (function_exists (' Imap_open ')) {
echo "IMAP functions are available.<br/>\n";
} else {
echo "IMAP functions are not available.<br/>\n";
}