uTools-Manuals/docs/php/ob_end_clean.html
2019-04-08 23:22:26 +08:00

105 lines
4.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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.ob-end-clean" class="refentry">
<div class="refnamediv">
<h1 class="refname">ob_end_clean</h1>
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">ob_end_clean</span> &mdash; <span class="dc-title">清空(擦除)缓冲区并关闭输出缓冲</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.ob-end-clean-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>ob_end_clean</strong></span>
( <span class="methodparam">void</span>
) : <span class="type">bool</span></div>
<p class="para rdfs-comment">
此函数丢弃最顶层输出缓冲区的内容并关闭这个缓冲区。如果想要进一步处理缓冲区的内容,必须在<span class="function"><strong>ob_end_clean()</strong></span>之前调用<span class="function"><a href="ob_get_contents.html" class="function">ob_get_contents()</a></span>,因为当调用<span class="function"><strong>ob_end_clean()</strong></span>时缓冲区内容将被丢弃。
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.ob-end-clean-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
成功时返回 <strong><code>TRUE</code></strong> 或者在失败时返回 <strong><code>FALSE</code></strong>。 错误的原因首先是,在调用时没有一个起作用的缓冲区,或者是因为某些原因缓冲区不能被删除(可能对特殊缓冲区而言)。
</p>
</div>
<div class="refsect1 errors" id="refsect1-function.ob-end-clean-errors">
<h3 class="title">错误/异常</h3>
<p class="para">
如果函数失败了,将引发一个<strong><code>E_NOTICE</code></strong>异常。
</p>
</div>
<div class="refsect1 changelog" id="refsect1-function.ob-end-clean-changelog">
<h3 class="title">更新日志</h3>
<p class="para">
<table class="doctable informaltable">
<thead>
<tr>
<th>版本</th>
<th>说明</th>
</tr>
</thead>
<tbody class="tbody">
<tr>
<td>4.2.0</td>
<td>
添加了布尔返回值。
</td>
</tr>
</tbody>
</table>
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.ob-end-clean-examples">
<h3 class="title">范例</h3>
<p class="para">
下面的例子给出了一种去除所有输出缓冲区的方法:
</p>
<p class="para">
<div class="example" id="example-473">
<p><strong>Example #1 <span class="function"><strong>ob_end_clean()</strong></span> example</strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />ob_start</span><span style="color: #007700">();<br />echo&nbsp;</span><span style="color: #DD0000">'Text&nbsp;that&nbsp;won\'t&nbsp;get&nbsp;displayed.'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">ob_end_clean</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
</div>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.ob-end-clean-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="ob_start.html" class="function" rel="rdfs-seeAlso">ob_start()</a> - 打开输出控制缓冲</span></li>
<li class="member"><span class="function"><a href="ob_get_contents.html" class="function" rel="rdfs-seeAlso">ob_get_contents()</a> - 返回输出缓冲区的内容</span></li>
<li class="member"><span class="function"><a href="ob_flush.html" class="function" rel="rdfs-seeAlso">ob_flush()</a> - 冲刷出(送出)输出缓冲区中的内容</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>