downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<func_num_argsget_defined_functions>
Last updated: Thu, 26 Jun 2008

function_exists

(PHP 4, PHP 5)

function_exists — Return TRUE if the given function has been defined

Description

bool function_exists ( string $function_name )

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

Parameters

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() and echo().

Examples

Example #1 function_exists() example

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

Notes

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



add a noteadd a note User Contributed Notes
Return TRUE if the given function has been defined
There are no user contributed notes for this page.




<func_num_argsget_defined_functions>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs