get_defined_functions 返回所有已定义函数的数组
发表日期:2021-07-01 08:57:16 | 来源: | | 浏览(1342) 分类:函数处理 函数
get_defined_functions
(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)
get_defined_functions — 返回所有已定义函数的数组
说明
get_defined_functions(bool
$exclude_disabled = false): array获取所有已定义函数的数组。
参数
-
exclude_disabled -
禁用的函数是否应该在返回的数据里排除。
返回值
返回数组,包含了所有已定义的函数,包括内置(internal) 和用户定义的函数。 可通过$arr["internal"]来访问系统内置函数, 通过$arr["user"]来访问用户自定义函数 (参见示例)。
更新日志
| 版本 | 说明 |
|---|---|
| PHP 7.0.15, PHP 7.1.1 |
增加 exclude_disabled 参数。
|
范例
示例 #1 get_defined_functions() 例子
<?php
function myrow($id, $data){
return "<tr><th>$id</th><td>$data</td></tr>\n";
}
$arr = get_defined_functions();
print_r($arr);
?>
以上例程的输出类似于:
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
)
)
参见
- function_exists() - 如果给定的函数已经被定义就返回 true
- get_defined_vars() - 返回由所有已定义变量所组成的数组
- get_defined_constants() - 返回所有常量的关联数组,键是常量名,值是常量值
- get_declared_classes() - 返回由已定义类的名字所组成的数组
- PHP(0)
- PHP杂项(34)
- PHP基础-李炎恢系列课程(20)
- 中文函数手册(0)
- 错误处理 函数(13)
- OPcache 函数(6)
- PHP 选项/信息 函数(54)
- Zip 函数(10)
- Hash 函数(15)
- OpenSSL 函数(63)
- Date/Time 函数(51)
- 目录函数(9)
- Fileinfo 函数(6)
- iconv 函数(11)
- 文件系统函数(81)
- 多字节字符串 函数(57)
- GD 和图像处理 函数(114)
- 可交换图像信息(5)
- Math 函数(50)
- 程序执行函数(11)
- PCNTL 函数(23)
- JSON 函数(4)
- SPL 函数(15)
- URL 函数(10)
- cURL 函数(32)
- 网络 函数(33)
- FTP 函数(36)
- Session 函数(23)
- PCRE 函数(11)
- PCRE 正则语法(19)
- 数组 函数(81)
- 类/对象 函数(18)
- 函数处理 函数(13)
- call_user_func_array 调用回调函数,并把一个数组参数作为回调函数的参数(0)
- call_user_func 把第一个参数作为回调函数调用(0)
- create_function Create an anonymous (lambda-style) function(0)
- forward_static_call_array Call a static method and pass the arguments as array(0)
- forward_static_call Call a static method(0)
- func_get_arg 返回参数列表的某一项(0)
- func_get_args 返回一个包含函数参数列表的数组(0)
- func_num_args Returns the number of arguments passed to the function(0)
- function_exists 如果给定的函数已经被定义就返回 true(0)
- get_defined_functions 返回所有已定义函数的数组(0)
- register_shutdown_function 注册一个会在php中止时执行的函数(0)
- register_tick_function Register a function for execution on each tick(0)
- unregister_tick_function De-register a function for execution on each tick(0)
- 变量处理 函数(37)
- SimpleXML 函数(3)
- 杂项 函数(31)
- 字符串 函数(101)
宁公网安备 64010402001209号