September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool function_exists(string function_name) Determines whether a function is defined.
Returns:
TRUE if the function exists; FALSE otherwise
Description:
function_exists() is used to determine whether the given function is defined in the current PHP environment.
Availability:
UNIX, Windows
Version:
3.0.7+, 4+
See also:
To find out whether a given method or class is defined:
method_exists() class_exists()
Example:
$function_name = 'get_big_raise';
if (function_exists ($function_name))
print "Function <tt>$function_name</tt> exists (and there was much rejoicing).";
else
print "Function <tt>$function_name</tt> does not exist.";
|
Read now
Unlock full access