<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mbstring.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.mb-output-handler.php',
    1 => 'mb_output_handler',
    2 => '出力バッファ内で文字エンコーディングを変換するコールバック関数',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'マルチバイト文字列 関数',
  ),
  'prev' => 
  array (
    0 => 'function.mb-ord.php',
    1 => 'mb_ord',
  ),
  'next' => 
  array (
    0 => 'function.mb-parse-str.php',
    1 => 'mb_parse_str',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/mbstring/functions/mb-output-handler.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_output_handler</span> &mdash; <span class="dc-title">出力バッファ内で文字エンコーディングを変換するコールバック関数</span></p>
 
 </div>
   
 <div class="refsect1 description" id="refsect1-function.mb-output-handler-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_output_handler</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$status</code></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>mb_output_handler()</strong></span> は、
   <span class="function"><a href="function.ob-start.php" class="function">ob_start()</a></span> のコールバック関数です。
   <span class="function"><strong>mb_output_handler()</strong></span> は、出力バッファの文字を
   内部文字エンコーディングから HTTP 出力文字エンコーディングに変換します。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-output-handler-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       出力バッファの中身。
      </p>
     </dd>
    
    
     <dt><code class="parameter">status</code></dt>
     <dd>
      <p class="para">
       出力バッファの状態。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.mb-output-handler-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   変換後の文字列を返します。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.mb-output-handler-examples">
  <h3 class="title">例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>例1 <span class="function"><strong>mb_output_handler()</strong></span> の例</strong></p>
    <div class="example-contents">
<div class="annotation-interactive 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" id="refsect1-function.mb-output-handler-notes">
  <h3 class="title">注意</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    イメージのようなバイナリデータを出力したい場合、
    バイナリデータを送信する前に <span class="function"><a href="function.header.php" class="function">header()</a></span> により
    Content-Type: ヘッダ(例：header(&quot;Content-Type: image/png&quot;))を
    送信する必要があります。Content-Type: ヘッダが送信されると出力文字
    コード変換は無効となります。
   </p>
   <p class="para">
    &#039;Content-Type: text/*&#039;
    を送信した場合には、テキストが送信されるとみなし、文字コード設定に
    基づいて出力文字コード変換を行います。
   </p>
  </p></blockquote>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.mb-output-handler-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.ob-start.php" class="function" rel="rdfs-seeAlso">ob_start()</a> - 出力のバッファリングを有効にする</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>