<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.mb-chr.php',
    1 => 'mb_chr',
    2 => 'Return character by Unicode code point value',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Multibyte String Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.mb-check-encoding.php',
    1 => 'mb_check_encoding',
  ),
  'next' => 
  array (
    0 => 'function.mb-convert-case.php',
    1 => 'mb_convert_case',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mbstring/functions/mb-chr.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-chr" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_chr</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.2.0, PHP 8)</p><p class="refpurpose"><span class="refname">mb_chr</span> &mdash; <span class="dc-title">Return character by Unicode code point value</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-chr-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_chr</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$codepoint</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Returns a string containing the character specified by the Unicode code point value,
   encoded in the specified encoding.
  </p>
  <p class="para">
   This function complements <span class="function"><a href="function.mb-ord.php" class="function">mb_ord()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-chr-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <dl>
   
    <dt><code class="parameter">codepoint</code></dt>
    <dd>
     <p class="para">
      A Unicode codepoint value, e.g. <code class="literal">128024</code> for <em>U+1F418 ELEPHANT</em>
     </p>
    </dd>
   
   
    <dt><code class="parameter">encoding</code></dt>
    <dd>
     <p class="para">Der Parameter <code class="parameter">encoding</code>
legt die Zeichenkodierung fest. Wird er nicht übergeben, so wird die interne
Zeichenkodierung genutzt.</p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-chr-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   A string containing the requested character, if it can be represented in the specified
   encoding Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben..
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-chr-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">encoding</code> ist nun nullable (akzeptiert den
  <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>-Wert).
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.mb-chr-examples">
  <h3 class="title">Beispiele</h3>
  <div class="example" id="example-1">
   <p><strong>Beispiel #1 Testen unterschiedlicher Codepoints</strong></p>
   <div class="example-contents">
    <div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$values </span><span style="color: #007700">= [</span><span style="color: #0000BB">65</span><span style="color: #007700">, </span><span style="color: #0000BB">63</span><span style="color: #007700">, </span><span style="color: #0000BB">0x20AC</span><span style="color: #007700">, </span><span style="color: #0000BB">128024</span><span style="color: #007700">];<br />foreach (</span><span style="color: #0000BB">$values </span><span style="color: #007700">as </span><span style="color: #0000BB">$value</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mb_chr</span><span style="color: #007700">(</span><span style="color: #0000BB">$value</span><span style="color: #007700">, </span><span style="color: #DD0000">'UTF-8'</span><span style="color: #007700">));<br />    </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mb_chr</span><span style="color: #007700">(</span><span style="color: #0000BB">$value</span><span style="color: #007700">, </span><span style="color: #DD0000">'ISO-8859-1'</span><span style="color: #007700">));<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt folgende Ausgabe:</p></div>
   <div class="example-contents screen">
    <div class="annotation-interactive examplescode"><pre class="examplescode">string(1) &quot;A&quot;
string(1) &quot;A&quot;
string(1) &quot;?&quot;
string(1) &quot;?&quot;
string(3) &quot;€&quot;
bool(false)
string(4) &quot;🐘&quot;
bool(false)</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mb-chr-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mb-internal-encoding.php" class="function" rel="rdfs-seeAlso">mb_internal_encoding()</a> - Set/Get internal character encoding</span></li>
    <li><span class="function"><a href="function.mb-ord.php" class="function" rel="rdfs-seeAlso">mb_ord()</a> - Get Unicode code point of character</span></li>
    <li><span class="function"><a href="intlchar.ord.php" class="function" rel="rdfs-seeAlso">IntlChar::ord()</a> - Return Unicode code point value of character</span></li>
    <li><span class="function"><a href="function.chr.php" class="function" rel="rdfs-seeAlso">chr()</a> - Erzeugt eine Ein-Byte-Zeichenkette aus einer Zahl</span></li>
   </ul>
  </p>
 </div>


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