array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.function-exists.php', 1 => 'function_exists', ), 'up' => array ( 0 => 'ref.funchand.php', 1 => '函数处理 函数', ), 'prev' => array ( 0 => 'function.func-num-args.php', 1 => 'func_num_args', ), 'next' => array ( 0 => 'function.get-defined-functions.php', 1 => 'get_defined_functions', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/funchand/functions/function-exists.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
function
函数名,必须为一个字符串。
示例 #1 function_exists() 的例子
<?php
if (function_exists('imap_open')) {
echo "IMAP functions are available.<br />\n";
} else {
echo "IMAP functions are not available.<br />\n";
}
?>
注意:
即使函数本身由于配置或者编译选项而无法使用,该函数名也可能存在(image 就是一个现成的例子)。