<?php
$array = array(
"1" => 'Hi',
"4" => 'are',
"3" => 'How',
"7" => 'my',
"6" => 'you',
"9" => 'brother',
);
forEach($array as $key => $value) {
echo $key;
echo ':-';
print_r($value);
echo '<br/>';
}
?>
the out put of this code is
1:-Hi
4:-are
3:-How
7:-my
6:-you
9:-brother
but i need to display this order by key. please tell me which is easiest way
thanks
Use ksort