reference/array/functions/krsort.xml
4acad9b77f9422b44aa58266f5fe1585b5bb3fe5
4acad9b77f9422b44aa58266f5fe1585b5bb3fe5
...
...
@@ -3,20 +3,23 @@
3
3
<refentry xml:id="function.krsort" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>krsort</refname>
6
-
<refpurpose>Sort an array by key in reverse order</refpurpose>
6
+
<refpurpose>Sort an array by key in descending order</refpurpose>
7
7
</refnamediv>
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>bool</type><methodname>krsort</methodname>
11
+
<type>true</type><methodname>krsort</methodname>
12
12
<methodparam><type>array</type><parameter role="reference">array</parameter></methodparam>
13
-
<methodparam choice="opt"><type>int</type><parameter>sort_flags</parameter><initializer>SORT_REGULAR</initializer></methodparam>
13
+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>SORT_REGULAR</constant></initializer></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
-
Sorts an array by key in reverse order, maintaining key to data
17
-
correlations. This is useful mainly for associative arrays.
16
+
Sorts <parameter>array</parameter> in place by keys
17
+
in descending order.
18
18
</para>
19
+
¬e.sort-unstable;
20
+
¬e.reset-index;
19
21
</refsect1>
22
+
20
23
<refsect1 role="parameters">
21
24
&reftitle.parameters;
22
25
<para>
...
...
@@ -29,25 +32,44 @@
29
32
</para>
30
33
</listitem>
31
34
</varlistentry>
32
-
<varlistentry>
33
-
<term><parameter>sort_flags</parameter></term>
34
-
<listitem>
35
-
<para>
36
-
You may modify the behavior of the sort using the optional parameter
37
-
<parameter>sort_flags</parameter>, for details see
38
-
<function>sort</function>.
39
-
</para>
40
-
</listitem>
41
-
</varlistentry>
35
+
&sort.flags.parameter;
42
36
</variablelist>
43
37
</para>
44
38
</refsect1>
39
+
45
40
<refsect1 role="returnvalues">
46
41
&reftitle.returnvalues;
47
42
<para>
48
-
&return.success;
43
+
&return.true.always;
44
+
</para>
45
+
</refsect1>
46
+
47
+
<refsect1 role="changelog">
48
+
&reftitle.changelog;
49
+
<para>
50
+
<informaltable>
51
+
<tgroup cols="2">
52
+
<thead>
53
+
<row>
54
+
<entry>&Version;</entry>
55
+
<entry>&Description;</entry>
56
+
</row>
57
+
</thead>
58
+
<tbody>
59
+
&return.type.true;
60
+
<row>
61
+
<entry>8.2.0</entry>
62
+
<entry>
63
+
This function now does numeric string comparison under
64
+
<constant>SORT_REGULAR</constant> using the standard PHP 8 rules.
65
+
</entry>
66
+
</row>
67
+
</tbody>
68
+
</tgroup>
69
+
</informaltable>
49
70
</para>
50
71
</refsect1>
72
+
51
73
<refsect1 role="examples">
52
74
&reftitle.examples;
53
75
<para>
...
...
@@ -76,18 +98,17 @@ a = orange
76
98
</example>
77
99
</para>
78
100
</refsect1>
101
+
79
102
<refsect1 role="seealso">
80
103
&reftitle.seealso;
81
-
<para>
82
-
<simplelist>
83
-
<member><function>arsort</function></member>
84
-
<member><function>ksort</function></member>
85
-
<member>&seealso.array.sorting;</member>
86
-
</simplelist>
87
-
</para>
104
+
<simplelist>
105
+
<member><function>sort</function></member>
106
+
<member><function>ksort</function></member>
107
+
<member>&seealso.array.sorting;</member>
108
+
</simplelist>
88
109
</refsect1>
89
-
</refentry>
90
110
111
+
</refentry>
91
112
<!-- Keep this comment at the end of the file
92
113
Local variables:
93
114
mode: sgml
94
115