<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="collator.getsortkey" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>Collator::getSortKey</refname>
  <refname>collator_get_sort_key</refname>
  <refpurpose>Get sorting key for a string</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <para>
   &style.oop;
  </para>
  <methodsynopsis>
   <type>string</type>
   <methodname>Collator::getSortKey</methodname>
   <methodparam><type>string</type><parameter>str</parameter></methodparam>
  </methodsynopsis>
  <para>
   &style.procedural;
  </para>
  <methodsynopsis>
   <type>string</type>
   <methodname>collator_get_sort_key</methodname>
   <methodparam><type>Collator</type><parameter>coll</parameter></methodparam>
   <methodparam><type>string</type><parameter>str</parameter></methodparam>
  </methodsynopsis>
  <para>
   Return collation key for a string.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>coll</parameter></term>
     <listitem>
      <para>
       <classname>Collator</classname> object.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>str</parameter></term>
     <listitem>
      <para>
       The string to produce the key from.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>Returns the collation key for the string. Collation keys can be compared directly instead of strings.</para>
  &return.falseproblem;
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>collator_get_sort_key</function>example</title>
    <programlisting role="php">
<![CDATA[
<?php
$s1 = 'Hello';

$coll = collator_create( 'en_US' );
$res  = collator_get_sort_key( $coll, $s1);

echo urlencode($res);
?>
]]>
    </programlisting>
    &example.outputs;
    <screen>
     71%3F%3FE%01%09%01%8F%08%00
    </screen>
   </example>
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>collator_sort</function></member>
    <member><function>collator_sort_with_sort_keys</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
-->