<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.mb-str-split.php',
    1 => 'mb_str_split',
    2 => 'Pour une cha&icirc;ne multi-octets donn&eacute;e, renvoie un tableau de ses caract&egrave;res',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Fonctions sur les cha&icirc;nes de caract&egrave;res multioctets',
  ),
  'prev' => 
  array (
    0 => 'function.mb-str-pad.php',
    1 => 'mb_str_pad',
  ),
  'next' => 
  array (
    0 => 'function.mb-strcut.php',
    1 => 'mb_strcut',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/mbstring/functions/mb-str-split.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-str-split" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_str_split</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.4.0, PHP 8)</p><p class="refpurpose"><span class="refname">mb_str_split</span> &mdash; <span class="dc-title">Pour une chaîne multi-octets donnée, renvoie un tableau de ses caractères</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-str-split-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_str_split</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">$length</code><span class="initializer"> = 1</span></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"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   Cette fonction renverra un tableau de chaînes, c&#039;est une version de <span class="function"><a href="function.str-split.php" class="function">str_split()</a></span>
   avec une prise en charge des encodages de taille de caractère variable ainsi que des encodages de taille fixe 
   de caractères de 1, 2 ou 4 octets.
   Si le paramètre <code class="parameter">length</code> est spécifié, la chaîne est décomposée en blocs de la longueur 
   spécifiée en caractères (et non en octets).
   Le paramètre <code class="parameter">encoding</code> est facultatif mais il est recommandé de le fournir.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-str-split-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       La <a href="language.types.string.php" class="link">chaîne de caractères</a> à diviser en caractères ou en morceaux.
      </p>
     </dd>
    
    
     <dt><code class="parameter">length</code></dt>
     <dd>
      <p class="para">
        Si spécifié, chaque élément du tableau retourné sera composé de plusieurs caractères au lieu d&#039;un seul caractère.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      <p class="para">Le paramètre <code class="parameter">encoding</code>
est l&#039;encodage des caractères. S&#039;il est omis ou <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, l&#039;encodage de caractères interne
sera utilisé.</p>
      <p class="para">
       Une chaîne de caractères spécifiant l&#039;un des <a href="mbstring.supported-encodings.php" class="link">encodages pris en charge</a>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-str-split-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   <span class="function"><strong>mb_str_split()</strong></span> renvoie un tableau de chaînes de caractères.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-str-split-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">encoding</code> est désormais nullable.
 </td>
</tr>

     <tr>
      <td>8.0.0</td>
      <td>
       Cette fonction ne renvoie plus <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> en cas d&#039;échec.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.mb-str-split-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.str-split.php" class="function" rel="rdfs-seeAlso">str_split()</a> - Convertit une cha&icirc;ne de caract&egrave;res en tableau</span></li>
    <li><span class="function"><a href="function.grapheme-str-split.php" class="function" rel="rdfs-seeAlso">grapheme_str_split()</a> - S&eacute;pare une cha&icirc;ne en un tableau</span></li>
    <li><span class="function"><a href="function.explode.php" class="function" rel="rdfs-seeAlso">explode()</a> - Scinde une cha&icirc;ne de caract&egrave;res en segments</span></li>
   </ul>
  </p>
 </div>


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