cvs: phpdoc /en/reference/array/functions usort.xml

From: Date: Tue, 06 May 2003 20:30:27 +0000
Subject: cvs: phpdoc /en/reference/array/functions usort.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969353218@lists.php.net to get a copy of this message
david Tue May 6 16:30:27 2003 EDT Modified files: /phpdoc/en/reference/array/functions usort.xml Log: this example was confusing if you didn't read through to the end Index: phpdoc/en/reference/array/functions/usort.xml diff -u phpdoc/en/reference/array/functions/usort.xml:1.8 phpdoc/en/reference/array/functions/usort.xml:1.9 --- phpdoc/en/reference/array/functions/usort.xml:1.8 Tue Feb 4 12:19:32 2003 +++ phpdoc/en/reference/array/functions/usort.xml Tue May 6 16:30:27 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.usort"> <refnamediv> @@ -42,7 +42,7 @@ <![CDATA[ function cmp ($a, $b) { if ($a == $b) return 0; - return ($a > $b) ? -1 : 1; + return ($a < $b) ? -1 : 1; } $a = array (3, 2, 5, 6, 1); @@ -62,17 +62,17 @@ <para> <screen> <![CDATA[ -0: 6 -1: 5 +0: 1 +1: 2 2: 3 -3: 2 -4: 1 +3: 5 +4: 6 ]]> </screen> </para> <note> <para> - Obviously in this trivial case the <function>rsort</function> + Obviously in this trivial case the <function>sort</function> function would be more appropriate. </para> </note>

« previous php.doc (#969353218) next »