Source of: /manual/en/function.get-defined-functions.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.funchand.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'function.get-defined-functions.php',
1 => 'get_defined_functions',
),
'up' =>
array (
0 => 'ref.funchand.php',
1 => 'Function handling Functions',
),
'prev' =>
array (
0 => 'function.function-exists.php',
1 => 'function_exists',
),
'next' =>
array (
0 => 'function.register-shutdown-function.php',
1 => 'register_shutdown_function',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.get-defined-functions" class="refentry">
<div class="refnamediv">
<h1 class="refname">get_defined_functions</h1>
<p class="verinfo">(PHP 4 >= 4.0.4, PHP 5)</p><p class="refpurpose"><span class="refname">get_defined_functions</span> — <span class="dc-title">Returns an array of all defined functions</span></p>
</div>
<a name="function.get-defined-functions.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">array</span> <span class="methodname"><b>get_defined_functions</b></span>
( <span class="methodparam">void</span>
)</div>
<p class="para rdfs-comment">
Gets an array of all defined functions.
</p>
</div>
<a name="function.get-defined-functions.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns an multidimensional array containing a list of all defined
functions, both built-in (internal) and user-defined. The internal
functions will be accessible via <var class="varname">$arr["internal"]</var>, and
the user defined ones using <var class="varname">$arr["user"]</var> (see example
below).
</p>
</div>
<a name="function.get-defined-functions.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 <b>get_defined_functions()</b> example</b></p>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">myrow</span><span style="color: #007700">(</span><span style="color: #0000BB">$id</span><span style="color: #007700">, </span><span style="color: #0000BB">$data</span><span style="color: #007700">)<br />{<br /> return </span><span style="color: #DD0000">"<tr><th></span><span style="color: #0000BB">$id</span><span style="color: #DD0000"></th><td></span><span style="color: #0000BB">$data</span><span style="color: #DD0000"></td></tr>\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$arr </span><span style="color: #007700">= </span><span style="color: #0000BB">get_defined_functions</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$arr</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
<div class="example-contents para"><p>The above example will output
something similar to:</p></div>
<div class="example-contents screen">
<div class="cdata"><pre>
Array
(
[internal] => Array
(
[0] => zend_version
[1] => func_num_args
[2] => func_get_arg
[3] => func_get_args
[4] => strlen
[5] => strcmp
[6] => strncmp
...
[750] => bcscale
[751] => bccomp
)
[user] => Array
(
[0] => myrow
)
)
</pre></div>
</div>
</div><p>
</p>
</div>
<a name="function.get-defined-functions.seealso"></a><div class="refsect1 seealso">
<h3 class="title">See Also</h3>
<p class="para">
</p><ul class="simplelist">
<li class="member"><a href="function.function-exists.php" class="function" rel="rdfs-seeAlso">function_exists()</a> - Return TRUE if the given function has been defined</li>
<li class="member"><a href="function.get-defined-vars.php" class="function" rel="rdfs-seeAlso">get_defined_vars()</a> - Returns an array of all defined variables</li>
<li class="member"><a href="function.get-defined-constants.php" class="function" rel="rdfs-seeAlso">get_defined_constants()</a> - Returns an associative array with the names of all the constants and their values</li>
<li class="member"><a href="function.get-declared-classes.php" class="function" rel="rdfs-seeAlso">get_declared_classes()</a> - Returns an array with the name of the defined classes</li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>