<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.intl.grapheme.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.grapheme-str-split.php',
    1 => 'grapheme_str_split',
    2 => 'Разбивает строку на массив графемных кластеров',
  ),
  'up' => 
  array (
    0 => 'ref.intl.grapheme.php',
    1 => 'Функции Grapheme',
  ),
  'prev' => 
  array (
    0 => 'function.grapheme-extract.php',
    1 => 'grapheme_extract',
  ),
  'next' => 
  array (
    0 => 'function.grapheme-stripos.php',
    1 => 'grapheme_stripos',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/intl/grapheme/grapheme-str-split.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.grapheme-str-split" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">grapheme_str_split</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">grapheme_str_split</span> &mdash; <span class="dc-title">Разбивает строку на массив графемных кластеров</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.grapheme-str-split-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>grapheme_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="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   Функция возвращает массив строк и работает аналогично функции <span class="function"><a href="function.str-split.php" class="function">str_split()</a></span>,
   но разбивает строку по графемным кластерам — последовательностям одно- или многобайтовых кодовых точек,
   которыми кодируется единое для восприятия графическое представление символа.
   Функция разбивает строку на части заданной длины, если передали аргумент <code class="parameter">length</code>;
   длина отдельной части измеряется не в байтах, а в графемных кластерах.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.grapheme-str-split-parameters">
  <h3 class="title">Список параметров</h3>
  <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>), которую требуется разбить на части из одного
      или большего количества графемных кластеров.
      Параметр <code class="parameter">string</code> принимает строку, которая соответствует стандарту UTF-8.
     </p>
    </dd>
   
   
    <dt><code class="parameter">length</code></dt>
    <dd>
     <p class="para">
      Параметр <code class="parameter">length</code> определяет максимум графемных кластеров в одном элементе массива.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.grapheme-str-split-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="simpara">
   Функция <span class="function"><strong>grapheme_str_split()</strong></span> возвращает массив строк или <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, если возникла ошибка.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.grapheme-str-split-errors">
  <h3 class="title">Ошибки</h3>
  <p class="simpara">
   Функция выбросит ошибку <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span>,
   если значение параметра <code class="parameter">length</code> окажется меньше <code class="literal">1</code>.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.grapheme-str-split-seealso">
  <h3 class="title">Смотрите также</h3>
  <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.mb-str-split.php" class="function" rel="rdfs-seeAlso">mb_str_split()</a> - Возвращает массив символов многобайтовой строки</span></li>
   <li>
    <a href="http://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries" class="link external">&raquo;&nbsp;
     Сегментация текста в Юникоде: Границы графемных кластеров
    </a>
   </li>
  </ul>
 </div>

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