php-doc-en/reference/mbstring/functions/mb-str-split.xml
Christoph Michael Becker b95d28e6ec Fix return types
Functions which return false on failure should state that in their
signature as well.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351135 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-02 15:52:35 +00:00

94 lines
3 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 class="union"><type>array</type><type>false</type></type><methodname>mb_str_split</methodname>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>split_length</parameter><initializer>1</initializer></methodparam>
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>mb_internal_encoding()</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>split_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>split_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, &return.falseforfailure;.
</para>
</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
-->