techtonik Tue Apr 5 14:27:08 2005 EDT
Modified files:
/phpdoc/en/reference/array/functions array-multisort.xml
Log:
* more descriptive example
http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/array-multisort.xml?r1=1.15&r2=1.16&ty=u
Index: phpdoc/en/reference/array/functions/array-multisort.xml
diff -u phpdoc/en/reference/array/functions/array-multisort.xml:1.15
phpdoc/en/reference/array/functions/array-multisort.xml:1.16
--- phpdoc/en/reference/array/functions/array-multisort.xml:1.15 Sun Feb
13 23:13:13 2005
+++ phpdoc/en/reference/array/functions/array-multisort.xml Tue Apr 5
14:27:08 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.15 $ -->
+<!-- $Revision: 1.16 $ -->
<!-- splitted from ./en/functions/array.xml, last change in rev 1.11 -->
<refentry id="function.array-multisort">
<refnamediv>
@@ -119,32 +119,38 @@
<programlisting role="php">
<![CDATA[
<?php
-$ar = array(array("10", 100, 100, "a"), array(1, 3, "2", 1));
+$ar = array(
+ array("10", 11, 100, 100, "a"),
+ array( 1, 2, "2", 3, 1)
+ );
array_multisort($ar[0], SORT_ASC, SORT_STRING,
$ar[1], SORT_NUMERIC, SORT_DESC);
+var_dump($ar);
?>
]]>
</programlisting>
<para>
- In this example, after sorting, the first array will contain "10",
- 100, 100, "a" (it was sorted as strings in ascending order). The
- second will contain 1, 3, "2", 1 (sorted as numbers, in
- descending order).
+ In this example, after sorting, the first array will transform to
+ "10", 100, 100, 11, "a" (it was sorted as strings in ascending
+ order). The second will contain 1, 3, "2", 2, 1 (sorted as numbers,
+ in descending order).
</para>
<screen>
<![CDATA[
array(2) {
- [0]=> array(4) {
+ [0]=> array(5) {
[0]=> string(2) "10"
[1]=> int(100)
[2]=> int(100)
- [3]=> string(1) "a"
+ [3]=> int(11)
+ [4]=> string(1) "a"
}
- [1]=> array(4) {
+ [1]=> array(5) {
[0]=> int(1)
[1]=> int(3)
[2]=> string(1) "2"
- [3]=> int(1)
+ [3]=> int(2)
+ [4]=> int(1)
}
}
]]>