Webastor - Programming Tips and Tricks

Programming language => PHP => Topic started by: Ciaran on November 17, 2016, 07:04:54 PM

Title: What are different steps to sort an array in PHP?
Post by: Ciaran on November 17, 2016, 07:04:54 PM
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.
Title: Re: to sort an array in PHP?
Post by: Alan on January 09, 2018, 06:23:08 PM
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.