PHP.nl

function_exists

function_exists

Return true if the given function has been defined

bool **function_exists** string $function

Checks the list of defined functions, both built-in (internal) and user-defined, for . function

functionThe function name, as a string.

Returns true if exists and is a function, false otherwise. function

Opmerking: > This function will return false for constructs, such as and . include_once``echo

Voorbeeld: example

<?php
if (function_exists('imap_open')) {
    echo "IMAP functions are available.<br />\n";
} else {
    echo "IMAP functions are not available.<br />\n";
}
?>

Opmerking: > A function name may exist even if the function itself is unusable due to configuration or compiling options (with the functions being an example). image

method_exists``is_callable``get_defined_functions``class_exists``extension_loaded