⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.register-shutdown-function.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Register a function for execution on shutdown</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.get-defined-functions.html">get_defined_functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.register-tick-function.html">register_tick_function</a></div> <div class="up"><a href="ref.funchand.html">Function handling Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.register-shutdown-function" class="refentry"> <div class="refnamediv">  <h1 class="refname">register_shutdown_function</h1>  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">register_shutdown_function</span> &mdash; <span class="dc-title">Register a function for execution on shutdown</span></p> </div>  <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type"><span class="type void">void</span></span> <span class="methodname"><b><b>register_shutdown_function</b></b></span>    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.callback" class="type callback">callback</a></span> <tt class="parameter">$function</tt></span>   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter">$parameter</tt></span>   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter">$...</tt></span>  ]] )</div>  <p class="simpara">   Registers the function named by <i><tt class="parameter">function</tt></i> to be   executed when script processing is complete.  </p>  <p class="para">   Multiple calls to <b>register_shutdown_function()</b> can be   made, and each will be called in the same order as they were registered.   If you call <a href="function.exit.html" class="function">exit()</a> within one registered shutdown   function, processing will stop completely and no other registered   shutdown functions will be called.  </p>  <p class="para">   In PHP 4.0.6 and earlier under Apache,   the registered shutdown functions are called after the request has been   completed (including sending any output buffers), so it is not possible   to send output to the browser using <a href="function.echo.html" class="function">echo()</a> or   <a href="function.print.html" class="function">print()</a>, or retrieve the contents of any output   buffers using <a href="function.ob-get-contents.html" class="function">ob_get_contents()</a>.   Since PHP 4.1, the shutdown functions are called as the part of the   request so that it&#039;s possible to send the output from them. There is   currently no way to process the data with output buffering functions in   the shutdown function.   Shutdown function is called after closing all opened output buffers thus,   for example, its output will not be compressed if <a href="zlib.configuration.html#ini.zlib.output-compression" class="link">zlib.output_compression</a> is   enabled.  </p>  <p class="para">   As of PHP 4, it is possible to pass parameters to the shutdown function by   passing additional parameters to   <b>register_shutdown_function()</b>.  </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">function</tt></i></span>     <dd>      <p class="para">      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">parameter</tt></i></span>     <dd>      <p class="para">      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">...</tt></i></span>     <dd>      <p class="para">      </p>     </dd>    </dt>   </dl>  </p> </div> <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   No value is returned.  </p> </div> <div class="refsect1 notes">  <h3 class="title">Notes</h3>  <blockquote><p><b class="note">Note</b>:        Typically undefined functions cause fatal errors in PHP, but when the    <i><tt class="parameter">function</tt></i> called with    <b>register_shutdown_function()</b> is undefined, an error    of level <b><tt>E_WARNING</tt></b> is generated instead.  Also,    for reasons internal to PHP, this error will refer to    <i>Unknown</i> at line #0.   <br />  </p></blockquote>  <blockquote><p><b class="note">Note</b>:        Working directory of the script can change inside the shutdown function    under some web servers, e.g. Apache.   <br />  </p></blockquote>  <blockquote><p><b class="note">Note</b>:        Shutdown function is called during the script shutdown so headers are    always already sent.   <br />  </p></blockquote> </div> <div class="refsect1 seealso">  <h3 class="title">See Also</h3>  <p class="para">   <ul class="simplelist">    <li class="member"><a href="ini.core.html#ini.auto-append-file" class="link">auto_append_file</a></li>    <li class="member"><a href="function.exit.html" class="function" rel="rdfs-seeAlso">exit()</a></li>    <li class="member">The section on <a href="features.connection-handling.html" class="link">connection handling</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.get-defined-functions.html">get_defined_functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.register-tick-function.html">register_tick_function</a></div> <div class="up"><a href="ref.funchand.html">Function handling Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -