difference between sort(), assort() and ksort in php

difference between sort(), assort() and ksort in php


Sorts an array, sorts an array and maintains index association, Sorts an array by key
Simple sort (sorts on values)
Simple sort after sorting the array (lets assume size of array is 10) rearranges the index, if we want to access element at index[5], using a simple sort an element value would have changed, but in assort the value is still held by index 5 though its position in the array may be 10th.
Ksort – sorts the array by key and maintains the key to data correlations