cvs: phpdoc-pl /reference/array/functions uksort.xml

From: Date: Fri, 14 Apr 2006 09:26:40 +0000
Subject: cvs: phpdoc-pl /reference/array/functions uksort.xml
Groups: php.doc.pl 
Request: Send a blank email to doc-pl+get-809@lists.php.net to get a copy of this message
leszek Fri Apr 14 09:26:40 2006 UTC Modified files: /phpdoc-pl/reference/array/functions uksort.xml Log: [leszek] - updated to EN 1.18 http://cvs.php.net/viewcvs.cgi/phpdoc-pl/reference/array/functions/uksort.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc-pl/reference/array/functions/uksort.xml diff -u phpdoc-pl/reference/array/functions/uksort.xml:1.10 phpdoc-pl/reference/array/functions/uksort.xml:1.11 --- phpdoc-pl/reference/array/functions/uksort.xml:1.10 Mon Apr 3 15:56:54 2006 +++ phpdoc-pl/reference/array/functions/uksort.xml Fri Apr 14 09:26:40 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-2"?> -<!-- EN-Revision: 1.17 Maintainer: leszek Status: ready --> -<!-- $Revision: 1.10 $ --> +<!-- EN-Revision: 1.18 Maintainer: leszek Status: ready --> +<!-- $Revision: 1.11 $ --> <refentry id="function.uksort"> <refnamediv> <refname>uksort</refname> @@ -38,13 +38,12 @@ <?php function cmp($a, $b) { - if ($a == $b) { - return 0; - } - return ($a > $b) ? 1 : -1; + $a = ereg_replace('^(a|an|the) ', '', $a); + $b = ereg_replace('^(a|an|the) ', '', $b); + return strcasecmp($a, $b); } -$a = array(4 => "cztery", 3 => "trzy", 20 => "dwadzie¶cia", 10 => "dziesiêæ"); +$a = array("John" => 1, "the Earth" => 2, "an apple" => 3, "a banana" => 4); uksort($a, "cmp"); @@ -57,10 +56,10 @@ &example.outputs; <screen> <![CDATA[ -20: dwadzie¶cia -10: dziesiêæ -4: cztery -3: trzy +an apple: 3 +a banana: 4 +the Earth: 2 +John: 1 ]]> </screen> </example>

« previous php.doc.pl (#809) next »