-
Notifications
You must be signed in to change notification settings - Fork 800
[PHP 8.4] Add manual for grapheme_str_split function #3956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bc5a67a
[PHP 8.4] Add manual for grapheme_str_split function
youkidearitai 4043365
Update reference/intl/grapheme/grapheme-str-split.xml
youkidearitai cbf8550
Update reference/intl/grapheme/grapheme-str-split.xml
youkidearitai b6dbd9d
Fix from feedback
youkidearitai e738c40
Add throw error of grapheme_str_split
youkidearitai 1de18d2
Update reference/strings/functions/str-split.xml
youkidearitai f544b25
Update reference/intl/grapheme/grapheme-str-split.xml
youkidearitai e84b922
Update reference/intl/grapheme/grapheme-str-split.xml
youkidearitai 710bad8
Fix trailing space
youkidearitai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
<refentry xml:id="function.grapheme-str-split" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>grapheme_str_split</refname> | ||
<refpurpose>Split a string into an array</refpurpose> | ||
</refnamediv> | ||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type class="union"><type>array</type><type>false</type></type><methodname>grapheme_str_split</methodname> | ||
<methodparam><type>string</type><parameter>string</parameter></methodparam> | ||
<methodparam choice="opt"><type>int</type><parameter>length</parameter><initializer>1</initializer></methodparam> | ||
</methodsynopsis> | ||
<para> | ||
This function will return an array of strings, | ||
it is a version of <function>str_split</function> | ||
with support for grapheme cluster byte characters. | ||
If the <parameter>length</parameter> parameter is specified, | ||
the string is broken down into chunks of the specified length | ||
in grapheme clusters (not bytes). | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<para> | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>string</parameter></term> | ||
<listitem> | ||
<para> | ||
The <type>string</type> to split into grapheme clusters or chunks. | ||
<parameter>string</parameter> must be valid UTF-8. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>length</parameter></term> | ||
<listitem> | ||
<para> | ||
Each element of the returned array will be composed of <parameter>length</parameter> grapheme clusters. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<para> | ||
<function>grapheme_str_split</function> returns an array of strings, &return.falseforfailure;. | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="errors"> | ||
&reftitle.errors; | ||
<para> | ||
If <parameter>length</parameter> is less than <literal>1</literal>, | ||
a <classname>ValueError</classname> will be thrown. | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<para> | ||
<simplelist> | ||
<member><function>str_split</function></member> | ||
<member><function>mb_str_split</function></member> | ||
<member> | ||
<link xlink:href="&uri.unicode.graphemes;"> | ||
Unicode Text Segmentation: Grapheme Cluster Boundaries | ||
</link> | ||
</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 | ||
--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.