note 31407 rejected from function.array-multisort by spic

From: Date: Mon, 21 Apr 2003 07:31:10 +0000
Subject: note 31407 rejected from function.array-multisort by spic
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-46869@lists.php.net to get a copy of this message
I want to rearrange the following Stringstructure with array_multisort: <? # Before: $string = "2-3-60065|5-1-20053|8-2-60512|1-1-35421|4-2-99241|7-3-18152"; $array1 = explode("|",$string); foreach($array1 as $value){ list($a,$b,$c) = explode("-",$value); $array2[$a][0]=$b; $array2[$a][1]=$c; } # array_multisort(???); # After multisort $string2 = "7-3-18152|5-1-20053|1-1-35421|2-3-60065|8-2-60512|4-2-99241"; ?> I hope you can see, that I want to sort by the 3rd element of each subarray...

« previous php.notes (#46869) next »