我想要一个用户定义的函数来排序多维数组:
<?php
$arr1 = array(
49,
8,
array(
'Muazam',
'Ali',
'Rana',
'Amina',
'Surya',
'Danish',
'Raina',
4,
3,
2,
1,
) ,
7,
6,
5,
4,
3,
2,
1,
0,
);
function abc($arr)
{
$len = count($arr) - 2;
foreach($arr as $key => $value)
{
for ($a = 0; $a <= $len; $a++)
{
if ($arr[$a] > $arr[$a + 1])
{
$temp4 = $arr[$a];
$arr[$a] = $arr[$a + 1];
$arr[$a + 1] = $temp4;
}
}
if (is_array($value))
{
abc($value, $a = $a + 1);
}
}
} //2nd foreach close
echo "<pre>";
print_r($arr);
echo "</pre>";
}