this example was confusing if you didn't read through to the end

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@126067 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
David Croft 2003-05-06 20:30:27 +00:00
parent 3955bc539c
commit cc50ece11c

View file

@ -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 @@ while (list ($key, $value) = each ($a)) {
<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>