mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 13:57:03 +08:00
141 lines
5.8 KiB
HTML
141 lines
5.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>返回所有已定义函数的数组</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><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, PHP 7)</p><p class="refpurpose"><span class="refname">get_defined_functions</span> — <span class="dc-title">返回所有已定义函数的数组</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.get-defined-functions-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>get_defined_functions</strong></span>
|
|
([ <span class="methodparam"><span class="type">bool</span> <code class="parameter">$exclude_disabled</code><span class="initializer"> = <strong><code>FALSE</code></strong></span></span>
|
|
] ) : <span class="type">array</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
获取所有已定义函数的数组。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.get-defined-functions-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">exclude_disabled</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
禁用的函数是否应该在返回的数据里排除。
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.get-defined-functions-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
返回数组,包含了所有已定义的函数,包括内置(internal) 和用户定义的函数。 可通过<var class="varname"><var class="varname">$arr["internal"]</var></var>来访问系统内置函数, 通过<var class="varname"><var class="varname">$arr["user"]</var></var>来访问用户自定义函数 (参见示例)。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 changelog" id="refsect1-function.get-defined-functions-changelog">
|
|
<h3 class="title">更新日志</h3>
|
|
<table class="doctable informaltable">
|
|
|
|
<thead>
|
|
<tr>
|
|
<th>版本</th>
|
|
<th>说明</th>
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody class="tbody">
|
|
<tr>
|
|
<td>PHP 7.0.15, PHP 7.1.1</td>
|
|
<td>
|
|
增加 <code class="parameter">exclude_disabled</code> 参数。
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.get-defined-functions-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-6207">
|
|
<p><strong>Example #1 <span class="function"><strong>get_defined_functions()</strong></span> 例子</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><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>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents"><p>以上例程的输出类似于:</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>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.get-defined-functions-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="function_exists.html" class="function" rel="rdfs-seeAlso">function_exists()</a> - 如果给定的函数已经被定义就返回 TRUE</span></li>
|
|
<li class="member"><span class="function"><a href="get_defined_vars.html" class="function" rel="rdfs-seeAlso">get_defined_vars()</a> - 返回由所有已定义变量所组成的数组</span></li>
|
|
<li class="member"><span class="function"><a href="get_defined_constants.html" class="function" rel="rdfs-seeAlso">get_defined_constants()</a> - 返回所有常量的关联数组,键是常量名,值是常量值</span></li>
|
|
<li class="member"><span class="function"><a href="get_declared_classes.html" class="function" rel="rdfs-seeAlso">get_declared_classes()</a> - 返回由已定义类的名字所组成的数组</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |