The following example sorts an associative array in ascending order, according to the key:
<?php $age = array("Ram"=>"30", "Shyam"=>"27", "Karan"=>"40"); ksort($age); ?>
The following example sorts an associative array in ascending order, according to the key:
<?php $age = array("Ram"=>"30", "Shyam"=>"27", "Karan"=>"40"); ksort($age); ?>