您的位置:首页 > 编程语言 > PHP开发

php检测函数是否存在函数 function_exists

2014-09-15 19:59 716 查看
php检测函数是否存在函数 function_exists

语法

bool function_exists ( string $function_name )
检查的定义的函数的列表,同时内置(内部)和用户定义的,为function_name。
返回值

如果function_name是一个函数存在,返回true,否则返回false。

if (function_exists('imap_open')) {
echo "imap functions are available.www.afish.cnblogs.com";
} else {
echo "imap functions are not available.
n";
}

//function_exists returns false on null and empty string:

if (function_exists('')) {
echo "empty string function existsn";
}

if (function_exists(null)) {
echo "null function existsn";
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: