$array = array(5,4,6,8,5,3,4,6,1);
I want to sort $array like asort does, but the problem is that asort is a function and its product can't be stored in a variable.
How can I do something like this?:
$array = array(5,4,6,8,5,3,4,6,1);
$sorted_array = asort($array);
Edit: I also want $array to keep its original order.
asortbecause it is sorted inside$arrayand now you can directly access sorted array using$array.