PHP ksort() function
The PHP ksort() sorts an associative array in ascending order, according to the key. It is mainly used for an associative array. This function was introduced in PHP 4.0.
The ksort() function returns true on success and false on failure.
Array ( [ganguly] => 46 [sachin] => 45 [virat] => 29 )
Array ( [a] => cricket [b] => hockey [c] => football [d] => badminton )
Array ( [china] =>beijing [france] =>paris [india] =>newdelhi [russia] =>moscow [united kingdom] =>london )
Array ( [z] => ruby [y] => java [x] => html )