php-doc-en/reference/mbstring/functions/mb-str-split.xml
Christoph Michael Becker 92f1b8b177 Generate ext/mbstring methodsynopses based on stubs
Closes GH-190.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@352028 c90b9560-bf6c-de11-be94-00142212c4b1
2020-12-12 16:32:35 +00:00

116 lines
3.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.mb-str-split" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mb_str_split</refname>
<refpurpose>Given a multibyte string, return an array of its characters</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>mb_str_split</methodname>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>length</parameter><initializer>1</initializer></methodparam>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
This function will return an array of strings, it is a version of <function>str_split</function> with support for encodings of variable character size as well as fixed-size encodings of 1,2 or 4 byte characters.
If the <parameter>length</parameter> parameter is specified, the string is broken down into chunks of the specified length in characters (not bytes).
The <parameter>encoding</parameter> parameter can be optionally specified and it is good practice to do so.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
The &string; to split into characters or chunks.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>length</parameter></term>
<listitem>
<para>
If specified, each element of the returned array will be composed of multiple characters instead of a single character.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>encoding</parameter></term>
<listitem>
&mbstring.encoding.parameter;
<para>
A string specifying one of the supported encodings.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<function>mb_str_split</function> returns an array of strings.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&mbstring.changelog.encoding-nullable;
<row>
<entry>8.0.0</entry>
<entry>
This function no longer returns &false; on failure.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>str_split</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->