<?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 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.mb-str-split.php',
    1 => 'mb_str_split',
    2 => 'Возвращает массив символов многобайтовой строки',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Функции для работы с многобайтовыми строками',
  ),
  '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' => 'ru',
    '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">Возвращает массив символов многобайтовой строки</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-str-split-description">
  <h3 class="title">Описание</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">
   Функция возвращает массив строк и работает аналогично функции <span class="function"><a href="function.str-split.php" class="function">str_split()</a></span>,
   но поддерживает кодировки с переменным размером символов
   и кодировки с фиксированным размером символов из 1, 2 или 4 байтов.
   Функция разобьёт строку на части заданной длины, если указали
   параметр <code class="parameter">length</code>; длина отдельной части измеряется не в байтах, а в символах.
   Кодировку символов строки указывают в необязательном параметре <code class="parameter">encoding</code>,
   и это хорошая практика.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-str-split-parameters">
  <h3 class="title">Список параметров</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       Строка (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>), которую требуется разбить на отдельные символы
       или части из двух или большего количества символов.
      </p>
     </dd>
    
    
     <dt><code class="parameter">length</code></dt>
     <dd>
      <p class="para">
       Функция составит и вернёт массив, каждый элемент которого состоит
       не из одного, а из заданного количества символов.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      
<p class="para">
 Параметр <code class="parameter">encoding</code> указывает кодировку символов.
 При пропуске параметра или передаче значения <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>
 функция интерпретирует символы в предустановленной кодировке модуля.
</p>
      <p class="para">
       Строка, которая указывает <a href="mbstring.supported-encodings.php" class="link">поддерживаемую кодировку</a>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-str-split-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="para">
   Функция возвращает массив строк.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-str-split-changelog">
  <h3 class="title">Список изменений</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версия</th>
      <th>Описание</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.0.0</td>
 <td>
  Параметр <code class="parameter">encoding</code> теперь принимает значение <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
 </td>
</tr>

     <tr>
      <td>8.0.0</td>
      <td>
       Функция больше не возвращает <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, если возникла ошибка.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.mb-str-split-seealso">
  <h3 class="title">Смотрите также</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> - Преобразовывает строку в массив</span></li>
    <li><span class="function"><a href="function.grapheme-str-split.php" class="function" rel="rdfs-seeAlso">grapheme_str_split()</a> - Разбивает строку на массив графемных кластеров</span></li>
    <li><span class="function"><a href="function.explode.php" class="function" rel="rdfs-seeAlso">explode()</a> - Разбивает строку разделителем</span></li>
   </ul>
  </p>
 </div>


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