array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.get-defined-functions.php', 1 => 'get_defined_functions', ), 'up' => array ( 0 => 'ref.funchand.php', 1 => '函数处理 函数', ), 'prev' => array ( 0 => 'function.function-exists.php', 1 => 'function_exists', ), 'next' => array ( 0 => 'function.register-shutdown-function.php', 1 => 'register_shutdown_function', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/funchand/functions/get-defined-functions.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)
get_defined_functions — 返回所有已定义函数的数组
exclude_disabled
禁用的函数是否应该在返回的数据里排除。
返回数组,包含了所有已定义的函数,包括内置/用户定义的函数。可通过 $arr["internal"] 来访问系统内置函数,通过 $arr["user"] 来访问用户自定义函数(参见示例)。
示例 #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 ) )