Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

function_exists(3) [php man page]

FUNCTION_EXISTS(3)							 1							FUNCTION_EXISTS(3)

function_exists - Return TRUEif the given function has been defined

SYNOPSIS
bool function_exists (string $function_name) DESCRIPTION
Checks the list of defined functions, both built-in (internal) and user-defined, for $function_name. PARAMETERS
o $function_name - The function name, as a string. RETURN VALUES
Returns TRUE if $function_name exists and is a function, FALSE otherwise. Note This function will return FALSE for constructs, such as include_once(3) and echo(3). EXAMPLES
Example #1 function_exists(3) example <?php if (function_exists('imap_open')) { echo "IMAP functions are available.<br /> "; } else { echo "IMAP functions are not available.<br /> "; } ?> NOTES
Note A function name may exist even if the function itself is unusable due to configuration or compiling options (with the image func- tions being an example). SEE ALSO
method_exists(3), is_callable(3), get_defined_functions(3), class_exists(3), extension_loaded(3). PHP Documentation Group FUNCTION_EXISTS(3)

Check Out this Related Man Page

DEFINED(3)								 1								DEFINED(3)

defined - Checks whether a given named constant exists

SYNOPSIS
bool defined (string $name) DESCRIPTION
Checks whether the given constant exists and is defined. Note If you want to see if a variable exists, use isset(3) as defined(3) only applies to constants. If you want to see if a function exists, use function_exists(3). PARAMETERS
o $name - The constant name. RETURN VALUES
Returns TRUE if the named constant given by $name has been defined, FALSE otherwise. EXAMPLES
Example #1 Checking Constants <?php /* Note the use of quotes, this is important. This example is checking * if the string 'TEST' is the name of a constant named TEST */ if (defined('TEST')) { echo TEST; } ?> SEE ALSO
define(3), constant(3), get_defined_constants(3), function_exists(3), The section on Constants. PHP Documentation Group DEFINED(3)
Man Page