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