|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<!-- $Revision$ --> |
| 3 | +<refentry xml:id="function.grapheme-str-split" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 4 | + <refnamediv> |
| 5 | + <refname>grapheme_str_split</refname> |
| 6 | + <refpurpose>Given a grapheme cluster string, which must be encoded in UTF-8</refpurpose> |
| 7 | + </refnamediv> |
| 8 | + <refsect1 role="description"> |
| 9 | + &reftitle.description; |
| 10 | + <para>&style.procedural;</para> |
| 11 | + <methodsynopsis> |
| 12 | + <type class="union"><type>array</type><type>false</type></type><methodname>grapheme_str_split</methodname> |
| 13 | + <methodparam><type>string</type><parameter>string</parameter></methodparam> |
| 14 | + <methodparam choice="opt"><type>int</type><parameter>length</parameter><initializer>1</initializer></methodparam> |
| 15 | + </methodsynopsis> |
| 16 | + <para> |
| 17 | + This function will return an array of strings, it is a version of <function>str_split</function> with support for grapheme cluster byte characters. |
| 18 | + If the <parameter>length</parameter> parameter is specified, the string is broken down into chunks of the specified length in grapheme clusters (not bytes). |
| 19 | + </para> |
| 20 | + </refsect1> |
| 21 | + |
| 22 | + <refsect1 role="parameters"> |
| 23 | + &reftitle.parameters; |
| 24 | + <para> |
| 25 | + <variablelist> |
| 26 | + <varlistentry> |
| 27 | + <term><parameter>string</parameter></term> |
| 28 | + <listitem> |
| 29 | + <para> |
| 30 | + The &string; to split into grapheme clusters or chunks. Must be valid UTF-8. |
| 31 | + </para> |
| 32 | + </listitem> |
| 33 | + </varlistentry> |
| 34 | + <varlistentry> |
| 35 | + <term><parameter>length</parameter></term> |
| 36 | + <listitem> |
| 37 | + <para> |
| 38 | + If specified, each element of the returned array will be composed of grapheme clusters instead of a single grapheme cluster. |
| 39 | + </para> |
| 40 | + </listitem> |
| 41 | + </varlistentry> |
| 42 | + </variablelist> |
| 43 | + </para> |
| 44 | + </refsect1> |
| 45 | + |
| 46 | + <refsect1 role="seealso"> |
| 47 | + &reftitle.seealso; |
| 48 | + <para> |
| 49 | + <simplelist> |
| 50 | + <member><function>str_split</function></member> |
| 51 | + <member><function>mb_str_split</function></member> |
| 52 | + <member> |
| 53 | + <link xlink:href="&uri.unicode.graphemes;"> |
| 54 | + Unicode Text Segmentation: Grapheme Cluster Boundaries |
| 55 | + </link> |
| 56 | + </member> |
| 57 | + </simplelist> |
| 58 | + </para> |
| 59 | + </refsect1> |
| 60 | +</refentry> |
| 61 | +<!-- Keep this comment at the end of the file |
| 62 | +Local variables: |
| 63 | +mode: sgml |
| 64 | +sgml-omittag:t |
| 65 | +sgml-shorttag:t |
| 66 | +sgml-minimize-attributes:nil |
| 67 | +sgml-always-quote-attributes:t |
| 68 | +sgml-indent-step:1 |
| 69 | +sgml-indent-data:t |
| 70 | +indent-tabs-mode:nil |
| 71 | +sgml-parent-document:nil |
| 72 | +sgml-default-dtd-file:"~/.phpdoc/manual.ced" |
| 73 | +sgml-exposed-tags:nil |
| 74 | +sgml-local-catalogs:nil |
| 75 | +sgml-local-ecat-files:nil |
| 76 | +End: |
| 77 | +vim600: syn=xml fen fdm=syntax fdl=2 si |
| 78 | +vim: et tw=78 syn=sgml |
| 79 | +vi: ts=1 sw=1 |
| 80 | +--> |
0 commit comments