- krsort: documentation ( source)
- asort: documentation ( source)
- arsort: documentation ( source)
- ksort: documentation ( source)
<?php
$age=array("Sophia"=>"31","Jacob"=>"41","William"=>"39","Ramesh"=>"40");
asort($age);
ksort($age);
arsort($age);
krsort($age);
foreach($age as $key=>$value)
{
echo "key is : ".$key." value is : ".$value;
}
?>