Code:
<?php
$arr = array('5'=>'10','7'=>'8','3'=> '12','14'=>'1');
ksort($arr);
foreach($arr as $key=>$val){
print "Key:".$key." value:".$val."<br />";
}
print "<br />";
krsort($arr);
foreach($arr as $key=>$val){
print "Key:".$key." value:".$val."<br />";
}
?>
Comments
Post a Comment