- var_dump: documentation ( source)
- ksort: documentation ( source)
<?php
$test = array(
"texas" => array(
"withers field B" => array("name" => "beam pump 3"),
"z should go second" => array("name" => "beam pump 2"),
"a should go first" => array("name" =>"beam pump 1")
)
);
function multiLevelSort($arr)
{
if (is_array($arr))
{
ksort($arr);
foreach($arr as $value)
{
$value = multiLevelSort($value);
}
}
return $arr;
}
echo("hello");
$test = multiLevelSort($test);
echo(var_dump($test));
?>