Php checks whether the function function_exists exists. Php checks whether function function_exists syntax boolfunction_exists (string $ function_name) checks the list of defined functions, both built-in (internal) and user-defined, checks for php whether the function has a list of defined functions checked by the function function_exists (string $ function_name) syntax bool function_exists. the built-in (internal) and user-defined functions are function_name. Return value
Php Tutorial: Check whether the function function_exists exists
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.bkjia.com
N ";
} 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 ";
}
// 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 );
}
Define function_exists syntax bool function_exists (string $ function_name) checks the list of defined functions, both built-in (internal) and user-defined,...