From caec5e0640f5d05621f40b2580428152f373da4d Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 5 Apr 2006 08:28:14 +0000 Subject: [PATCH] Change example to something different than krsort() git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@210690 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/array/functions/uksort.xml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/reference/array/functions/uksort.xml b/reference/array/functions/uksort.xml index 4bd1840ad4..2e691624ca 100644 --- a/reference/array/functions/uksort.xml +++ b/reference/array/functions/uksort.xml @@ -1,5 +1,5 @@ - + @@ -40,13 +40,12 @@ $b) ? 1 : -1; + $a = ereg_replace('^(a|an|the) ', '', $a); + $b = ereg_replace('^(a|an|the) ', '', $b); + return strcasecmp($a, $b); } -$a = array(4 => "four", 3 => "three", 20 => "twenty", 10 => "ten"); +$a = array("John" => 1, "the Earth" => 2, "an apple" => 3, "a banana" => 4); uksort($a, "cmp"); @@ -59,10 +58,10 @@ foreach ($a as $key => $value) { &example.outputs;