php检测函数是否存在函数 function_exists
生活随笔
收集整理的这篇文章主要介绍了
php检测函数是否存在函数 function_exists
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
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";
}
转载于:https://www.cnblogs.com/afish/p/3973535.html
总结
以上是生活随笔为你收集整理的php检测函数是否存在函数 function_exists的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 我的博客51CTO
- 下一篇: PHP版本的自动生成有规则的订单号(或编