The function described in this article is actually the PHP manual, but because these functions are more independent, easy to find, so separate introduction, convenient to consult.
1. Get all available modules-get_loaded_extensions This function returns all loaded (available) modules.
Usage:
Copy CodeThe code is as follows:
Print_r (Get_loaded_extensions ());
2. Gets the available functions for the specified module-Get_extension_funcs The function returns all available functions for the specified module. The parameter passed in (module name) must be lowercase
Usage:
Copy CodeThe code is as follows:
Print_r (Get_extension_funcs ("GD"));
3. Get all defined functions-get_defined_functions This function returns all functions that have been defined, including built-in functions and user-defined functions.
Usage:
Copy CodeThe code is as follows:
function Myrow ($id, $data) {
Return "$id$data\ n ";
}
$arr = Get_defined_functions ();
Print_r ($arr);
Output:
Copy CodeThe code is 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
...
[+] = Bcscale
[751] = Bccomp
)
[User] = Array
(
[0] = Myrow
)
)
where $arr ["internal"] is a built-in function, $arr ["User"] is a user-defined function.
4. Check if the specified function exists-function_exists The function returns whether the specified function has already been defined.
Usage:
Copy CodeThe code is as follows:
if (function_exists (' Imap_open ')) {
echo "IMAP functions is available.
\ n ";
} else {
echo "IMAP functions is not available.
\ n ";
}
http://www.bkjia.com/PHPjc/321617.html www.bkjia.com true http://www.bkjia.com/PHPjc/321617.html techarticle the function described in this article is actually the PHP manual, but because these functions are more independent, easy to find, so separate introduction, convenient to consult. 1. Get all the available ...