reference/intl/collator/get-sort-key.xml
1976eae0d815797af97a1e16c5cd90ffc2868395
...
...
@@ -12,23 +12,23 @@
12
12
<para>
13
13
&style.oop;
14
14
</para>
15
-
<methodsynopsis>
16
-
<modifier>public</modifier>
17
-
<type>string</type>
18
-
<methodname>Collator::getSortKey</methodname>
19
-
<methodparam><type>string</type><parameter>str</parameter></methodparam>
15
+
<methodsynopsis role="Collator">
16
+
<modifier>public</modifier> <type class="union"><type>string</type><type>false</type></type><methodname>Collator::getSortKey</methodname>
17
+
<methodparam><type>string</type><parameter>string</parameter></methodparam>
20
18
</methodsynopsis>
21
19
<para>
22
20
&style.procedural;
23
21
</para>
24
22
<methodsynopsis>
25
-
<type>string</type>
26
-
<methodname>collator_get_sort_key</methodname>
27
-
<methodparam><type>Collator</type><parameter>coll</parameter></methodparam>
28
-
<methodparam><type>string</type><parameter>str</parameter></methodparam>
23
+
<type class="union"><type>string</type><type>false</type></type><methodname>collator_get_sort_key</methodname>
24
+
<methodparam><type>Collator</type><parameter>object</parameter></methodparam>
25
+
<methodparam><type>string</type><parameter>string</parameter></methodparam>
29
26
</methodsynopsis>
30
27
<para>
31
28
Return collation key for a string.
29
+
Collation keys can be compared directly instead of strings, though are implementation
30
+
specific and may change between ICU library versions. Sort keys are generally only
31
+
useful in databases or other circumstances where function calls are extremely expensive.
32
32
</para>
33
33
</refsect1>
34
34

...
...
@@ -37,7 +37,7 @@
37
37
<para>
38
38
<variablelist>
39
39
<varlistentry>
40
-
<term><parameter>coll</parameter></term>
40
+
<term><parameter>object</parameter></term>
41
41
<listitem>
42
42
<para>
43
43
<classname>Collator</classname> object.
...
...
@@ -45,7 +45,7 @@
45
45
</listitem>
46
46
</varlistentry>
47
47
<varlistentry>
48
-
<term><parameter>str</parameter></term>
48
+
<term><parameter>string</parameter></term>
49
49
<listitem>
50
50
<para>
51
51
The string to produce the key from.
...
...
@@ -58,7 +58,7 @@
58
58

59
59
<refsect1 role="returnvalues">
60
60
&reftitle.returnvalues;
61
-
<para>Returns the collation key for the string. Collation keys can be compared directly instead of strings.</para>
61
+
<para>Returns the collation key for the string, &return.falseforfailure;.</para>
62
62
&return.falseproblem;
63
63
</refsect1>
64
64

...
...
@@ -72,16 +72,16 @@
72
72
<?php
73
73
$s1 = 'Hello';
74
74

75
-
$coll = collator_create( 'en_US' );
76
-
$res = collator_get_sort_key( $coll, $s1);
75
+
$coll = collator_create('en_US');
76
+
$res = collator_get_sort_key($coll, $s1);
77
77

78
-
echo urlencode($res);
78
+
echo bin2hex($res);
79
79
?>
80
80
]]>
81
81
</programlisting>
82
-
&example.outputs;
82
+
&example.outputs.similar;
83
83
<screen>
84
-
71%3F%3FE%01%09%01%8F%08%00
84
+
3832404046010901dc08
85
85
</screen>
86
86
</example>
87
87
</para>
...
...
@@ -97,7 +97,6 @@ echo urlencode($res);
97
97
</para>
98
98
</refsect1>
99
99
</refentry>
100
-

101
100
<!-- Keep this comment at the end of the file
102
101
Local variables:
103
102
mode: sgml
104
103