What are different steps to sort an array in PHP?

Started by Jaidon, November 17, 2016, 07:04:54 PM

Previous topic - Next topic

Ciaran

Hello everyone, I would like to ask you a little problem for the members of the community, what are different steps to sort an array in php? Thank you for answering the question.

Alan

There are many ways to sort an array in PHP, the easiest being to use the sort() function built into PHP. This sort function is quick but has it's limitations, especially when sorting things like dates as PHP usually guesses which value is higher than the other and can produce odd results. However, there are plenty of sorting algorithms available than can allow you to sort an array in any way you want.