PHP uses the Ksort () function to sort the associative array by key, Ksort the array
This example describes how PHP uses the Ksort () function to sort associative arrays by key. Share to everyone for your reference. The specific analysis is as follows:
PHP uses the Ksort () function to sort the associative array by key, and the Ksort function is sorted by the key of the associative array, if the reverse order can be Oh the Krsort () function
$first = Array ("x" =>5, "a" =>2, "F" =>1), Ksort ($first), foreach ($first as $key = = $val) {print "$key = $val
";}
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/969492.html www.bkjia.com true http://www.bkjia.com/PHPjc/969492.html techarticle PHP uses the Ksort () function to sort the associative array by key, the Ksort array describes the method by which PHP uses the Ksort () function to sort associative arrays by key. Share for the big ...