I have a MySQL query that gets the result of the entire MySQL database into a php array called $parents
then I have a foreach function loop that display result from that array
the function:
function subtree($id, $parents) {
if (isset($parents[$id]))
foreach ($parents[$id] as $child)
{
subtree($child, $parents);
}
}
I need to sort the array result of this function,
or to get the result into a new_sub_array
then sort it and display result
any way to modify the function to do what i need?