Syntax
Bool function_exists (string $ function_name)
Check the list of defined functions. Both built-in and user-defined functions are function_name.
Return value
Returns true. If function_name exists, it is a function. Otherwise, false is returned.
*/
If (function_exists ('imap _ open ')){
Echo "imap functions are available.www.111cn.net <br/> ";
} Else {
Echo "imap functions are not available. <br/> ";
}
// Function_exists returns false on null and empty string:
If (function_exists ('')){
Echo "empty string function exists ";
}
If (function_exists (null )){
Echo "null function exists ";
}
// If you use suhosin.exe cutor. func. blacklist instead of in your php. ini disabled_functions, function_exists returns true as the function. This is the same as suhosin.exe cutor. func. blacklist and disabled_functions beahviur:
Function suhosin_function_exists ($ func ){
If (extension_loaded ('suhosin ')){
$ Suhosin = @ ini_get ("suhosin.exe cutor. func. blacklist ");
If (empty ($ suhosin) = false ){
$ Suhosin = explode (',', $ suhosin );
$ Suhosin = array_map ('trim', $ suhosin );
$ Suhosin = array_map ('strtolower ', $ suhosin );
Return (function_exists ($ func) = true & array_search ($ func, $ suhosin) = false );
}
}
Return function_exists ($ func );
}