asort
php
bool asort ( array &$tablica )Sorts $tablica from lowest to highest value, preserving the keys associated with the values. Returns true if sorting succeeds.
Example:
php
$owoce = array();
$owoce["d"] = "lemon";
$owoce["a"] = "orange";
$owoce["b"] = "banana";
$owoce["c"] = "pineapple";
asort($owoce);
print_r($owoce);Result:
Array
(
[b] => banana
[d] => lemon
[a] => orange
[c] => pineapple
)