reference/array/functions/arsort.xml
2ca090342977839edca2f7f4e52305a1b5da6095
...
...
@@ -3,24 +3,26 @@
3
3
<refentry xml:id="function.arsort" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>arsort</refname>
6
-
<refpurpose>Sort an array in reverse order and maintain index association</refpurpose>
6
+
<refpurpose>Sort an array in descending order and maintain index association</refpurpose>
7
7
</refnamediv>
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>bool</type><methodname>arsort</methodname>
11
+
<type>true</type><methodname>arsort</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
-
This function sorts an array such that array indices maintain their
17
-
correlation with the array elements they are associated with.
16
+
Sorts <parameter>array</parameter> in place in descending order,
17
+
such that its keys maintain their correlation with the values they
18
+
are associated with.
18
19
</para>
19
20
<para>
20
21
This is used mainly when sorting associative arrays where the actual
21
22
element order is significant.
22
23
</para>
23
24
&note.sort-unstable;
25
+
&note.reset-index;
24
26
</refsect1>
25
27
<refsect1 role="parameters">
26
28
&reftitle.parameters;
...
...
@@ -34,25 +36,37 @@
34
36
</para>
35
37
</listitem>
36
38
</varlistentry>
37
-
<varlistentry>
38
-
<term><parameter>sort_flags</parameter></term>
39
-
<listitem>
40
-
<para>
41
-
You may modify the behavior of the sort using the optional parameter
42
-
<parameter>sort_flags</parameter>, for details see
43
-
<function>sort</function>.
44
-
</para>
45
-
</listitem>
46
-
</varlistentry>
39
+
&sort.flags.parameter;
47
40
</variablelist>
48
41
</para>
49
42
</refsect1>
43
+

50
44
<refsect1 role="returnvalues">
51
45
&reftitle.returnvalues;
52
46
<para>
53
-
&return.success;
47
+
&return.true.always;
54
48
</para>
55
49
</refsect1>
50
+

51
+
<refsect1 role="changelog">
52
+
&reftitle.changelog;
53
+
<para>
54
+
<informaltable>
55
+
<tgroup cols="2">
56
+
<thead>
57
+
<row>
58
+
<entry>&Version;</entry>
59
+
<entry>&Description;</entry>
60
+
</row>
61
+
</thead>
62
+
<tbody>
63
+
&return.type.true;
64
+
</tbody>
65
+
</tgroup>
66
+
</informaltable>
67
+
</para>
68
+
</refsect1>
69
+

56
70
<refsect1 role="examples">
57
71
&reftitle.examples;
58
72
<para>
...
...
@@ -85,17 +99,17 @@ c = apple
85
99
</example>
86
100
</para>
87
101
</refsect1>
102
+

88
103
<refsect1 role="seealso">
89
104
&reftitle.seealso;
90
-
<para>
91
-
<simplelist>
92
-
<member><function>asort</function></member>
93
-
<member>&seealso.array.sorting;</member>
94
-
</simplelist>
95
-
</para>
105
+
<simplelist>
106
+
<member><function>sort</function></member>
107
+
<member><function>asort</function></member>
108
+
<member>&seealso.array.sorting;</member>
109
+
</simplelist>
96
110
</refsect1>
97
-
</refentry>
98
111

112
+
</refentry>
99
113
<!-- Keep this comment at the end of the file
100
114
Local variables:
101
115
mode: sgml
102
116