php检测函数是否存在函数 function_exists
php檢測函數(shù)是否存在函數(shù) function_exists
語法
bool function_exists ( string $function_name )
檢查的定義的函數(shù)的列表,同時內(nèi)置(內(nèi)部)和用戶定義的,為function_name。
返回值
如果function_name是一個函數(shù)存在,返回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";
}
?
轉(zhuǎn)載于:https://www.cnblogs.com/afish/p/3973535.html
總結(jié)
以上是生活随笔為你收集整理的php检测函数是否存在函数 function_exists的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 我的博客51CTO
- 下一篇: 给Xshell设置舒适的配色方案