Possible Duplicate:
How do I sort a multidimensional array in php
I have multidimensional array, for exaple this:
$mas = array("s",array("c","b","a"),array(3,5,1),"a",array("s",array("z","a")));
I want sort (ascending) all array-elements, i write recursive function, but it is not working, please tell me, who I have a wrong ?
$mas = array("s",array("c","b","a"),array(3,5,1),"a",array("s",array("z","a")));
function sortsort($m) {
sort($m);
foreach ($m as &$v) {
if (is_array($v)) {
sortsort($v);
}
}
return $m;
}
var_dump(sortsort($mas));