This question already has an answer here:
- How can I sort arrays and data in PHP? 10 answers
How do you sort an array in numerical order, based on a numerical value within the element: where the element is a String?
for eg. from:
Array(
0 => One:3
1 => Two:1
2 => Three:4
3 => Four:2
)
to:
Array(
0 => Two:1
1 => Four:2
2 => One:3
3 => Three:4
)
</div>