参数
function-
函数名,必须为一个字符串。
示例
示例 #1 function_exists() 的例子
<?php
if (function_exists('imap_open')) {
echo "IMAP functions are available.<br />\n";
} else {
echo "IMAP functions are not available.<br />\n";
}
?>注释
注意:
即使函数本身由于配置或者编译选项而无法使用,该函数名也可能存在(image 就是一个现成的例子)。
参见
- method_exists() - 检查类的方法是否存在
- is_callable() - 验证值是否可以在当前范围内作为函数调用
- get_defined_functions() - 返回所有已定义函数的数组
- class_exists() - 查类是否已经定义
- extension_loaded() - 检查一个扩展是否已经加载