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

📄 function.mb-output-handler.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>Callback function converts character encoding in output buffer</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.mb-list-encodings.html">mb_list_encodings</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mb-parse-str.html">mb_parse_str</a></div> <div class="up"><a href="ref.mbstring.html">Multibyte String Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.mb-output-handler" class="refentry"> <div class="refnamediv">  <h1 class="refname">mb_output_handler</h1>  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5)</p><p class="refpurpose"><span class="refname">mb_output_handler</span> &mdash; <span class="dc-title">Callback function converts character encoding in output buffer</span></p>  </div>    <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">string</span> <span class="methodname"><b><b>mb_output_handler</b></b></span>    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$contents</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$status</tt></span>   )</div>  <p class="para rdfs-comment">   <b>mb_output_handler()</b> is   <a href="function.ob-start.html" class="function">ob_start()</a> callback   function. <b>mb_output_handler()</b> converts   characters in the output buffer from internal character encoding to   HTTP output character encoding.   </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">contents</tt></i></span>     <dd>      <p class="para">       The contents of the output buffer.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">status</tt></i></span>     <dd>      <p class="para">       The status of the output buffer.      </p>     </dd>    </dt>   </dl>  </p> </div>  <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   The converted <a href="language.types.string.html" class="type string">string</a>.  </p> </div> <div class="refsect1 changelog">  <h3 class="title">ChangeLog</h3>  <p class="para">   <table class="informaltable">    <colgroup>     <thead valign="middle">      <tr valign="middle">       <th colspan="1">Version</th>       <th colspan="1">Description</th>      </tr>     </thead>     <tbody valign="middle" class="tbody">      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">4.1.0</td>       <td colspan="1" rowspan="1" align="left">        <p class="para">         This handler now adds the charset HTTP header when the following conditions are met:        </p>        <p class="para">         <ul class="itemizedlist">          <li class="listitem">           <span class="simpara">            Does not set <i>Content-Type</i>, using <a href="function.header.html" class="function">header()</a>.           </span>          </li>          <li class="listitem">           <span class="simpara">            The default MIME type begins with <i>text/</i>.           </span>          </li>          <li class="listitem">           <span class="simpara">            The <a href="mbstring.configuration.html#ini.mbstring.http-input" class="link">mbstring.http_input</a>             setting is something other than <i>pass</i>.           </span>          </li>         </ul>        </p>       </td>      </tr>     </tbody>    </colgroup>   </table>  </p> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #1 <b>mb_output_handler()</b> example</b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />mb_http_output</span><span style="color: #007700">(</span><span style="color: #DD0000">"UTF-8"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">ob_start</span><span style="color: #007700">(</span><span style="color: #DD0000">"mb_output_handler"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>   </div>  </p> </div> <div class="refsect1 notes">  <h3 class="title">Notes</h3>  <blockquote><p><b class="note">Note</b>:        If you want to output some binary data such as image from PHP    script with PHP 4.3.0 or later, Content-Type: header must be send    using <a href="function.header.html" class="function">header()</a> before any binary data was send    to client (e.g. header(&quot;Content-Type: image/png&quot;)).    If Content-Type: header was send, output character encoding    conversion will not be performed.   <br />       Note that if &#039;Content-Type: text/*&#039; was send using    <a href="function.header.html" class="function">header()</a>, the sending data is regarded as text,    encoding conversion will be performed using character encoding    settings.   <br />       If you want to output some binary data such as image from PHP    script with PHP 4.2.x or earlier, you must set output encoding to    &quot;pass&quot; using <a href="function.mb-http-output.html" class="function">mb_http_output()</a>.   <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="function.ob-start.html" class="function" rel="rdfs-seeAlso">ob_start()</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.mb-list-encodings.html">mb_list_encodings</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mb-parse-str.html">mb_parse_str</a></div> <div class="up"><a href="ref.mbstring.html">Multibyte String 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 + -