码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2014-09-15 21:07:49      阅读:272      评论:0      收藏:0      [点我收藏+]

标签:blog   io   ar   sp   cti   log   on   c   r   

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";
}
 

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

标签:blog   io   ar   sp   cti   log   on   c   r   

原文地址:http://www.cnblogs.com/afish/p/3973535.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!