Home > Article > Backend Development > PHP - sorting function for arrays
PHP - Sort function for arrays
sort() - Sort an array in ascending order
rsort() - Sort an array in descending order
asort() - Sort an associative array in ascending order based on value Sort
ksort() - Sort an associative array in ascending order based on keys
arsort() - Sort an associative array in descending order based on values
krsort() - Sort an associative array in descending order based on keys