<?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 => 'es',
  ),
  'this' => 
  array (
    0 => 'function.mb-chr.php',
    1 => 'mb_chr',
    2 => 'Devuelve un car&aacute;cter por su valor de punto de c&oacute;digo Unicode',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Funciones de strings multibyte',
  ),
  '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' => 'es',
    '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">Devuelve un carácter por su valor de punto de código Unicode</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-chr-description">
  <h3 class="title">Descripción</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">
   Devuelve una cadena que contiene el carácter especificado por el valor del punto
   de código Unicode, codificado en la codificación especificada.
  </p>
  <p class="para">
   Esta función complementa a <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">Parámetros</h3>
  <dl>
   
    <dt><code class="parameter">codepoint</code></dt>
    <dd>
     <p class="para">
      Un valor de punto de código Unicode, p. ej. <code class="literal">128024</code>
      para <em>U+1F418 ELEPHANT</em>
     </p>
    </dd>
   
   
    <dt><code class="parameter">encoding</code></dt>
    <dd>
     <p class="para">El parámetro <code class="parameter">encoding</code>
es la codificación de caracteres. Si se omite o es <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, se utilizará el valor de la codificación
de caracteres interna.</p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-chr-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   Una cadena que contiene el carácter solicitado, si puede ser representado
   en la codificación especificada  o <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si ocurre un error.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-chr-changelog">
  <h3 class="title">Historial de cambios</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versión</th>
      <th>Descripción</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">encoding</code> ahora acepta <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.mb-chr-examples">
  <h3 class="title">Ejemplos</h3>
  <div class="example" id="example-1">
   <p><strong>Ejemplo #1 Probar diferentes puntos de código</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>El ejemplo anterior mostrará:</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">Ver también</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> - Lee/modifica la codificaci&oacute;n interna</span></li>
    <li><span class="function"><a href="function.mb-ord.php" class="function" rel="rdfs-seeAlso">mb_ord()</a> - Obtiene el punto de c&oacute;digo Unicode de un car&aacute;cter</span></li>
    <li><span class="function"><a href="intlchar.ord.php" class="function" rel="rdfs-seeAlso">IntlChar::ord()</a> - Devuelve el valor del punto de c&oacute;digo Unicode de un car&aacute;cter</span></li>
    <li><span class="function"><a href="function.chr.php" class="function" rel="rdfs-seeAlso">chr()</a> - Generar un string de un byte a partir de un n&uacute;mero</span></li>
   </ul>
  </p>
 </div>


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