note 108565 added to function.arsort
| From: | sebas2day | Date: | Mon, 07 May 2012 14:52:11 +0000 |
| Subject: | note 108565 added to function.arsort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187507@lists.php.net to get a copy of this message | ||
If you are dealing with a multidimensional array you want to sort, then this might be helpfull:
<?php
function array_sort($arr){
if(empty($arr)) return $arr;
foreach($arr as $k => $a){
if(!is_array($a)){
arsort($arr); // could be any kind of sort
return $arr;
}else{
$arr[$k] = array_sort($a);
}
}
return $arr;
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 77.170.37.39
----
Manual Page -- http://www.php.net/manual/en/function.arsort.php
Edit -- https://master.php.net/note/edit/108565
Del: integrated -- https://master.php.net/note/delete/108565/integrated
Del: useless -- https://master.php.net/note/delete/108565/useless
Del: bad code -- https://master.php.net/note/delete/108565/bad+code
Del: spam -- https://master.php.net/note/delete/108565/spam
Del: non-english -- https://master.php.net/note/delete/108565/non-english
Del: in docs -- https://master.php.net/note/delete/108565/in+docs
Del: other reasons-- https://master.php.net/note/delete/108565
Reject -- https://master.php.net/note/reject/108565
Search -- https://master.php.net/manage/user-notes.php