<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<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>
  <refpurpose>Get string length in grapheme units</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <para>&style.procedural;</para>
  <methodsynopsis>
   <type class="union"><type>int</type><type>false</type><type>null</type></type><methodname>grapheme_strlen</methodname>
   <methodparam><type>string</type><parameter>string</parameter></methodparam>
  </methodsynopsis>
  <para>
   Get string length in grapheme units (not bytes or characters)
  </para> 
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>string</parameter></term>
     <listitem>
      <para>
       The string being measured for length. It must be a valid UTF-8 string.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
   
 
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   The length of the string on success, &return.falseforfailure;. 
  </para>
 </refsect1>
 
 <refsect1 role="examples">
  &reftitle.examples;
  <example>
   <title><function>grapheme_strlen</function> example</title>
   <programlisting role="php">
<![CDATA[
<?php

$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>
  </example>
  &example.outputs;
  <screen>
<![CDATA[
6
]]>
  </screen>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member>
     <link xlink:href="&uri.unicode.graphemes;">
      Unicode Text Segmentation: Grapheme Cluster Boundaries
     </link>
    </member>
    <member><function>iconv_strlen</function></member>
    <member><function>mb_strlen</function></member>
    <member><function>strlen</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
-->
