i have the following associative array
word => count
where word is an english word ('more', 'creme', 'car' and so on), while count is the number of times that word appeared in a given string.
I want to sort by count.
Thx.
Ps. I tried usort but didn't work
<?php
$fruits = array("d" => 4, "a" => 3, "b" => 2, "c" => 1);
asort($fruits, SORT_NUMERIC);
foreach ($fruits as $key => $val) {
echo "$key = $val
";
}
?>