note 47940 deleted from function.array-multisort by aidan

From: Date: Fri, 07 Jan 2005 13:58:47 +0000
Subject: note 47940 deleted from function.array-multisort by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-82901@lists.php.net to get a copy of this message
Note Submitter: freakerz at gmail dot com ---- function msort($array_in) { foreach($array_in as $_key1 => $_value1) { foreach ($_value1 as $_key2 => $_value2) { $array_2sort[] = array($_key2,$_key1); } } foreach ($array_2sort as $_value1) { $array_str[] = implode(",",$_value1); } rsort($array_str,SORT_NUMERIC); foreach ($array_str as $_key => $_value) { $array_out[($_key+1)] = explode(",",$_value); $array_out[($_key+1)][1] = $array_in[$array_out[($_key+1)][1]][$array_out[($_key+1)][0]]; } return $array_out; }

« previous php.notes (#82901) next »