array(3) { [0]=> int(1) [1]=> int(100) [2]=> int(6) }
I want to sort the following array in numerical order max - min.
Expected output:
array(3) { [0]=> int(100) [1]=> int(6) [2]=> int(1) }
However, when I use asort($arr, SORT_NUMERIC)
or sort($arr, SORT_NUMERIC)
I get this unexpected result:
array(3) { [0]=> int(6) [1]=> int(100) [2]=> int(1) }