merge docs for graphemes

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@257829 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Stanislav Malyshev 2008-04-18 17:04:49 +00:00
parent 3322f2c725
commit 379f0fd299
10 changed files with 252 additions and 90 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.grapheme-extract" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_extract</refname>
@ -27,7 +27,7 @@
<term><parameter>haystack</parameter></term>
<listitem>
<para>
string to search
String to search.
</para>
</listitem>
</varlistentry>
@ -35,7 +35,7 @@
<term><parameter>size</parameter></term>
<listitem>
<para>
maximum number of grapheme clusters to return
Maximum number of grapheme clusters to return.
</para>
</listitem>
</varlistentry>
@ -43,7 +43,10 @@
<term><parameter>start</parameter></term>
<listitem>
<para>
starting position in $haystack in bytes
Starting position in $haystack in bytes - if given, it must be zero or a
positive value that is less than or equal to the length of $haystack in
bytes. The default is zero. If $start does not point to the first byte of a UTF-8
character, the start position is moved to the next character boundary.
</para>
</listitem>
</varlistentry>
@ -66,7 +69,12 @@
<programlisting role="php">
<![CDATA[
< ?php
TODO
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
print urlencode(grapheme_extract( $char_a_ring_nfd . $char_o_diaeresis_nfd, 1, 2));
?>
]]>
</programlisting>
@ -74,7 +82,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
o%CC%88
]]>
</screen>
</refsect1>
@ -82,7 +90,15 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>grapheme_extractb</function></member>
<member><function>grapheme_substr</function></member>
<member>
<link xlink:href="&uri.unicode.graphemes;">
Unicode Text Segmentation: Grapheme Cluster Boundaries
</link>
</member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.grapheme-extractb" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_extractb</refname>
@ -15,7 +15,8 @@
<methodparam choice='opt'><type>int</type><parameter>start</parameter></methodparam>
</methodsynopsis>
<para>
Function to extract a sequence of default grapheme clusters from a text buffer, which must be encoded in UTF-8.
Function to extract a sequence of default grapheme clusters from a text
buffer, which must be encoded in UTF-8, limited by a byte count.
</para>
</refsect1>
@ -27,7 +28,7 @@
<term><parameter>haystack</parameter></term>
<listitem>
<para>
string to search
String to search.
</para>
</listitem>
</varlistentry>
@ -35,7 +36,7 @@
<term><parameter>bsize</parameter></term>
<listitem>
<para>
maximum number of bytes to return
Maximum number of bytes to return.
</para>
</listitem>
</varlistentry>
@ -43,7 +44,11 @@
<term><parameter>start</parameter></term>
<listitem>
<para>
starting position in $haystack in bytes
Starting position in $haystack in bytes. If given, it must be zero or a
positive value that is less than or equal to the length of $haystack in
bytes. The default is zero. If $start does not point to the first byte of a
UTF-8 character, the start position is moved to the next character
boundary.
</para>
</listitem>
</varlistentry>
@ -66,7 +71,12 @@
<programlisting role="php">
<![CDATA[
< ?php
TODO
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
print urlencode(grapheme_extractb( $char_a_ring_nfd . $char_o_diaeresis_nfd, 4));
?>
]]>
</programlisting>
@ -74,7 +84,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
a%CC%8A
]]>
</screen>
</refsect1>
@ -82,7 +92,15 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>grapheme_extract</function></member>
<member><function>grapheme_substr</function></member>
<member>
<link xlink:href="&uri.unicode.graphemes;">
Unicode Text Segmentation: Grapheme Cluster Boundaries
</link>
</member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.grapheme-stripos" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_stripos</refname>
@ -16,8 +16,6 @@
</methodsynopsis>
<para>
Find position (in grapheme units) of first occurrence of a case-insensitive string
which character in haystack to start searching. The position
returned is still relative to the beginning of haystack.
</para>
</refsect1>
@ -29,7 +27,7 @@
<term><parameter>haystack</parameter></term>
<listitem>
<para>
The string to look in
The string to look in. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -37,7 +35,7 @@
<term><parameter>needle</parameter></term>
<listitem>
<para>
The string to look for
The string to look for. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -45,7 +43,10 @@
<term><parameter>offset</parameter></term>
<listitem>
<para>
The optional offset parameter allows you to specify
The optional $offset parameter allows you to specify where in haystack to
start searching as an offset in grapheme units (not bytes or characters). If not given, the default is zero.
The position returned is still relative to the beginning of haystack
regardless of the value of $offset.
</para>
</listitem>
</varlistentry>
@ -68,7 +69,13 @@
<programlisting role="php">
<![CDATA[
< ?php
TODO
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
$char_O_diaeresis_nfd = "O\xCC\x88"; // 'LATIN CAPITAL LETTER O WITH DIAERESIS' (U+00D6) normalization form "D"
print grapheme_stripos( $char_a_ring_nfd . $char_a_ring_nfd . $char_o_diaeresis_nfd, $char_O_diaeresis_nfd);
?>
]]>
</programlisting>
@ -76,7 +83,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
2
]]>
</screen>
</refsect1>
@ -84,7 +91,18 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>grapheme_stristr</function></member>
<member><function>grapheme_strpos</function></member>
<member><function>grapheme_strripos</function></member>
<member><function>grapheme_strrpos</function></member>
<member><function>grapheme_strstr</function></member>
<member>
<link xlink:href="&uri.unicode.graphemes;">
Unicode Text Segmentation: Grapheme Cluster Boundaries
</link>
</member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.grapheme-stristr" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_stristr</refname>
@ -16,7 +16,6 @@
</methodsynopsis>
<para>
Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack.
haystack before the first occurence of the needle.
</para>
</refsect1>
@ -28,7 +27,7 @@
<term><parameter>haystack</parameter></term>
<listitem>
<para>
The input string.
The input string. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -36,7 +35,7 @@
<term><parameter>needle</parameter></term>
<listitem>
<para>
The string to look for.
The string to look for. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -45,6 +44,7 @@
<listitem>
<para>
If TRUE (the default is FALSE), grapheme_strstr() returns the part of the
haystack before the first occurence of the needle.
</para>
</listitem>
</varlistentry>
@ -56,7 +56,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the portion of string, or FALSE if needle is not found.
Returns the portion of $haystack, or FALSE if $needle is not found.
</para>
</refsect1>
@ -67,7 +67,13 @@
<programlisting role="php">
<![CDATA[
< ?php
TODO
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
$char_O_diaeresis_nfd = "O\xCC\x88"; // 'LATIN CAPITAL LETTER O WITH DIAERESIS' (U+00D6) normalization form "D"
print urlencode(grapheme_stristr( $char_a_ring_nfd . $char_o_diaeresis_nfd . $char_a_ring_nfd, $char_O_diaeresis_nfd));
?>
]]>
</programlisting>
@ -75,7 +81,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
o%CC%88a%CC%8A
]]>
</screen>
</refsect1>
@ -83,7 +89,18 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>grapheme_stripos</function></member>
<member><function>grapheme_strpos</function></member>
<member><function>grapheme_strripos</function></member>
<member><function>grapheme_strrpos</function></member>
<member><function>grapheme_strstr</function></member>
<member>
<link xlink:href="&uri.unicode.graphemes;">
Unicode Text Segmentation: Grapheme Cluster Boundaries
</link>
</member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.grapheme-strlen" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_strlen</refname>
@ -13,7 +13,7 @@
<methodparam><type>string</type><parameter>input</parameter></methodparam>
</methodsynopsis>
<para>
Get string length in grapheme units
Get string length in grapheme units (not bytes or characters)
</para>
</refsect1>
@ -25,7 +25,7 @@
<term><parameter>input</parameter></term>
<listitem>
<para>
The string being measured for length.
The string being measured for length. It must be a valid UTF-8 string.
</para>
</listitem>
</varlistentry>
@ -48,7 +48,12 @@
<programlisting role="php">
<![CDATA[
< ?php
TODO
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
print grapheme_strlen( 'abc' . $char_a_ring_nfd . $char_o_diaeresis_nfd . $char_a_ring_nfd);
?>
]]>
</programlisting>
@ -56,7 +61,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
6
]]>
</screen>
</refsect1>
@ -64,7 +69,13 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member>
<link xlink:href="&uri.unicode.graphemes;">
Unicode Text Segmentation: Grapheme Cluster Boundaries
</link>
</member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.grapheme-strpos" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_strpos</refname>
@ -16,8 +16,6 @@
</methodsynopsis>
<para>
Find position (in grapheme units) of first occurrence of a string
which character in haystack to start searching. The position
returned is still relative to the beginning of haystack.
</para>
</refsect1>
@ -29,7 +27,7 @@
<term><parameter>haystack</parameter></term>
<listitem>
<para>
The string to look in
The string to look in. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -37,7 +35,7 @@
<term><parameter>needle</parameter></term>
<listitem>
<para>
The string to look for
The string to look for. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -45,7 +43,10 @@
<term><parameter>offset</parameter></term>
<listitem>
<para>
The optional offset parameter allows you to specify
The optional $offset parameter allows you to specify where in $haystack to
start searching as an offset in grapheme units (not bytes or characters). If not given, the default is zero.
The position returned is still relative to the beginning of haystack
regardless of the value of $offset.
</para>
</listitem>
</varlistentry>
@ -68,7 +69,12 @@
<programlisting role="php">
<![CDATA[
< ?php
TODO
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
print grapheme_strpos( $char_a_ring_nfd . $char_a_ring_nfd . $char_o_diaeresis_nfd, $char_o_diaeresis_nfd);
?>
]]>
</programlisting>
@ -76,7 +82,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
2
]]>
</screen>
</refsect1>
@ -84,7 +90,18 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>grapheme_stripos</function></member>
<member><function>grapheme_stristr</function></member>
<member><function>grapheme_strripos</function></member>
<member><function>grapheme_strrpos</function></member>
<member><function>grapheme_strstr</function></member>
<member>
<link xlink:href="&uri.unicode.graphemes;">
Unicode Text Segmentation: Grapheme Cluster Boundaries
</link>
</member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.grapheme-strripos" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_strripos</refname>
@ -16,8 +16,6 @@
</methodsynopsis>
<para>
Find position (in grapheme units) of last occurrence of a case-insensitive string
which character in haystack to start searching. The position
returned is still relative to the beginning of haystack.
</para>
</refsect1>
@ -29,7 +27,7 @@
<term><parameter>haystack</parameter></term>
<listitem>
<para>
The string to look in
The string to look in. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -37,7 +35,7 @@
<term><parameter>needle</parameter></term>
<listitem>
<para>
The string to look for
The string to look for. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -45,7 +43,10 @@
<term><parameter>offset</parameter></term>
<listitem>
<para>
The optional offset parameter allows you to specify
The optional $offset parameter allows you to specify where in $haystack to
start searching as an offset in grapheme units (not bytes or characters). If not given, the default is zero.
The position returned is still relative to the beginning of haystack
regardless of the value of $offset.
</para>
</listitem>
</varlistentry>
@ -68,7 +69,13 @@
<programlisting role="php">
<![CDATA[
< ?php
TODO
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
$char_O_diaeresis_nfd = "O\xCC\x88"; // 'LATIN CAPITAL LETTER O WITH DIAERESIS' (U+00D6) normalization form "D"
print grapheme_strripos( $char_a_ring_nfd . $char_o_diaeresis_nfd . $char_o_diaeresis_nfd, $char_O_diaeresis_nfd);
?>
]]>
</programlisting>
@ -76,7 +83,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
2
]]>
</screen>
</refsect1>
@ -84,7 +91,18 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>grapheme_stripos</function></member>
<member><function>grapheme_stristr</function></member>
<member><function>grapheme_strpos</function></member>
<member><function>grapheme_strrpos</function></member>
<member><function>grapheme_strstr</function></member>
<member>
<link xlink:href="&uri.unicode.graphemes;">
Unicode Text Segmentation: Grapheme Cluster Boundaries
</link>
</member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.grapheme-strrpos" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_strrpos</refname>
@ -16,8 +16,6 @@
</methodsynopsis>
<para>
Find position (in grapheme units) of last occurrence of a string
which character in haystack to start searching. The position
returned is still relative to the beginning of haystack.
</para>
</refsect1>
@ -29,7 +27,7 @@
<term><parameter>haystack</parameter></term>
<listitem>
<para>
The string to look in
The string to look in. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -37,7 +35,7 @@
<term><parameter>needle</parameter></term>
<listitem>
<para>
The string to look for
The string to look for. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -45,7 +43,10 @@
<term><parameter>offset</parameter></term>
<listitem>
<para>
The optional offset parameter allows you to specify
The optional $offset parameter allows you to specify where in $haystack to
start searching as an offset in grapheme units (not bytes or characters). If not given, the default is zero.
The position returned is still relative to the beginning of haystack
regardless of the value of $offset.
</para>
</listitem>
</varlistentry>
@ -68,7 +69,12 @@
<programlisting role="php">
<![CDATA[
< ?php
TODO
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
print grapheme_strrpos( $char_a_ring_nfd . $char_o_diaeresis_nfd . $char_o_diaeresis_nfd, $char_o_diaeresis_nfd);
?>
]]>
</programlisting>
@ -76,7 +82,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
2
]]>
</screen>
</refsect1>
@ -84,7 +90,18 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>grapheme_stripos</function></member>
<member><function>grapheme_stristr</function></member>
<member><function>grapheme_strpos</function></member>
<member><function>grapheme_strripos</function></member>
<member><function>grapheme_strstr</function></member>
<member>
<link xlink:href="&uri.unicode.graphemes;">
Unicode Text Segmentation: Grapheme Cluster Boundaries
</link>
</member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.grapheme-strstr" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_strstr</refname>
@ -16,7 +16,6 @@
</methodsynopsis>
<para>
Returns part of haystack string from the first occurrence of needle to the end of haystack.
haystack before the first occurence of the needle.
</para>
</refsect1>
@ -28,7 +27,7 @@
<term><parameter>haystack</parameter></term>
<listitem>
<para>
The input string.
The input string. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -36,7 +35,7 @@
<term><parameter>needle</parameter></term>
<listitem>
<para>
The string to look for.
The string to look for. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -45,6 +44,7 @@
<listitem>
<para>
If TRUE (the default is FALSE), grapheme_strstr() returns the part of the
haystack before the first occurence of the needle.
</para>
</listitem>
</varlistentry>
@ -67,7 +67,12 @@
<programlisting role="php">
<![CDATA[
< ?php
TODO
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
print urlencode(grapheme_stristr( $char_a_ring_nfd . $char_o_diaeresis_nfd . $char_a_ring_nfd, $char_o_diaeresis_nfd));
?>
]]>
</programlisting>
@ -75,7 +80,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
o%CC%88a%CC%8A
]]>
</screen>
</refsect1>
@ -83,7 +88,18 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>grapheme_stristr</function></member>
<member><function>grapheme_stripos</function></member>
<member><function>grapheme_strpos</function></member>
<member><function>grapheme_strripos</function></member>
<member><function>grapheme_strrpos</function></member>
<member>
<link xlink:href="&uri.unicode.graphemes;">
Unicode Text Segmentation: Grapheme Cluster Boundaries
</link>
</member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.grapheme-substr" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>grapheme_substr</refname>
@ -16,16 +16,7 @@
</methodsynopsis>
<para>
Return part of a string
start'th position in string, counting from zero. If start is negative,
the returned string will start at the start'th character from the
end of string.
at most length characters beginning from start (depending on the
length of string). If string is less than or equal to start characters
long, FALSE will be returned. If length is given and is negative, then
that many characters will be omitted from the end of string (after the
start position has been calculated when a start is negative). If start
denotes a position beyond this truncation, an empty string will be returned.
</para>
</para>
</refsect1>
<refsect1 role="parameters">
@ -36,7 +27,7 @@
<term><parameter>string</parameter></term>
<listitem>
<para>
The input string.
The input string. Must be valid UTF-8.
</para>
</listitem>
</varlistentry>
@ -44,7 +35,11 @@
<term><parameter>start</parameter></term>
<listitem>
<para>
If start is non-negative, the returned string will start at the
Start position in default grapheme units.
If $start is non-negative, the returned string will start at the
$start'th position in $string, counting from zero. If $start is negative,
the returned string will start at the $start'th character from the
end of string.
</para>
</listitem>
</varlistentry>
@ -52,7 +47,14 @@
<term><parameter>length</parameter></term>
<listitem>
<para>
If length is given and is positive, the string returned will contain
Length in grapheme units.
If $length is given and is positive, the string returned will contain
at most $length characters beginning from $start (depending on the
length of string). If $string is less than or equal to $start characters
long, FALSE will be returned. If $length is given and is negative, then
that many characters will be omitted from the end of string (after the
start position has been calculated when a start is negative). If $start
denotes a position beyond this truncation, an empty string will be returned.
</para>
</listitem>
</varlistentry>
@ -64,7 +66,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the extracted part of string.
Returns the extracted part of $string.
</para>
</refsect1>
@ -75,7 +77,11 @@
<programlisting role="php">
<![CDATA[
< ?php
TODO
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
print urlencode(grapheme_substr( "ao" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "O", 2, -1 ));
?>
]]>
</programlisting>
@ -83,7 +89,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
a%CC%8Abco%CC%88
]]>
</screen>
</refsect1>
@ -91,7 +97,15 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>grapheme_extract</function></member>
<member><function>grapheme_extractB</function></member>
<member>
<link xlink:href="&uri.unicode.graphemes;">
Unicode Text Segmentation: Grapheme Cluster Boundaries
</link>
</member>
</simplelist>
</para>
</refsect1>
</refentry>