2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2007-06-20 22:25:43 +00:00
|
|
|
<!-- $Revision: 1.7 $ -->
|
|
|
|
<refentry xml:id="function.function-exists" xmlns="http://docbook.org/ns/docbook">
|
2007-02-17 20:02:43 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>function_exists</refname>
|
|
|
|
<refpurpose>Return &true; if the given function has been defined</refpurpose>
|
|
|
|
</refnamediv>
|
2007-02-17 20:03:06 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-02-17 20:02:43 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>function_exists</methodname>
|
|
|
|
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
Checks the list of defined functions, both built-in (internal) and
|
2007-02-17 20:03:06 +00:00
|
|
|
user-defined, for <parameter>function_name</parameter>.
|
2007-02-17 20:02:43 +00:00
|
|
|
</para>
|
2007-02-17 20:03:06 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
2007-02-17 20:02:43 +00:00
|
|
|
<para>
|
2007-02-17 20:03:06 +00:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>function_name</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The function name, as a string.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
Returns &true; if <parameter>function_name</parameter> exists and is a
|
|
|
|
function, &false; otherwise.
|
|
|
|
</para>
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
This function will return &false; for constructs, such as
|
|
|
|
<function>include_once</function> and <function>echo</function>.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>function_exists</function> example</title>
|
2007-02-17 20:02:43 +00:00
|
|
|
<programlisting role="php">
|
2002-04-15 00:12:54 +00:00
|
|
|
<![CDATA[
|
2003-06-16 14:37:37 +00:00
|
|
|
<?php
|
2002-04-15 00:12:54 +00:00
|
|
|
if (function_exists('imap_open')) {
|
2003-06-16 14:37:37 +00:00
|
|
|
echo "IMAP functions are available.<br />\n";
|
2002-04-15 00:12:54 +00:00
|
|
|
} else {
|
2003-06-16 14:37:37 +00:00
|
|
|
echo "IMAP functions are not available.<br />\n";
|
2002-04-15 00:12:54 +00:00
|
|
|
}
|
2003-06-16 14:37:37 +00:00
|
|
|
?>
|
2002-04-15 00:12:54 +00:00
|
|
|
]]>
|
2007-02-17 20:02:43 +00:00
|
|
|
</programlisting>
|
2007-02-17 20:03:06 +00:00
|
|
|
</example>
|
2007-02-17 20:02:43 +00:00
|
|
|
</para>
|
2007-02-17 20:03:06 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
A function name may exist even if the function itself is unusable due to
|
|
|
|
configuration or compiling options (with the <link
|
|
|
|
linkend="ref.image">image</link> functions being an example).
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
2007-02-17 20:02:43 +00:00
|
|
|
<para>
|
2007-02-17 20:03:06 +00:00
|
|
|
<simplelist>
|
|
|
|
<member><function>method_exists</function></member>
|
|
|
|
<member><function>is_callable</function></member>
|
|
|
|
<member><function>get_defined_functions</function></member>
|
|
|
|
</simplelist>
|
2007-02-17 20:02:43 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-02-17 20:03:06 +00:00
|
|
|
|
2007-02-17 20:02:43 +00:00
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|