bool ksort ( array &$array [, int $sort_flags = SORT_REGULAR ] )
Sort an array by key
Sorts an array by key, maintaining key to data correlations. This is useful mainly for associative arrays.
<?php
$fruits = array("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
ksort($fruits);
foreach ($fruits as $key => $val) {
echo "$key = $val\n";
}
?>
11.-Curso PHP-MySQL. Clasificación de Arrays
0 Comment:
Post a Comment