DàCodice PHP:
<?php
$arr=array(8,4,16,12,28,11,59,101,57);
Print "prima :
";
Foreach ($arr as $key => $value) {
Print "arr[$key] => $value
";
}
Asort($arr);
Print "dopo :
";
Foreach ($arr as $key => $value) {
Print "arr[$key] => $value
";
}
?>
codice:prima : arr[0] => 8 arr[1] => 4 arr[2] => 16 arr[3] => 12 arr[4] => 28 arr[5] => 11 arr[6] => 59 arr[7] => 101 arr[8] => 57 dopo : arr[1] => 4 arr[0] => 8 arr[5] => 11 arr[3] => 12 arr[2] => 16 arr[4] => 28 arr[8] => 57 arr[6] => 59 arr[7] => 101