I have an array of string keys with numeric values to be used to create a list of tags with the number of occurrences of each tag resembling this:
$arrTags = [
'mango' => 2,
'orange' => 4,
'apple' => 2,
'banana' => 3
];
I want to display the tags in a list with descending values, then the tag names ascending to produce:
orange (4)
banana (3)
apple (2)
mango (2)
arsort() is not suitable because it will put mango before apple. I'm guessing that usort() may be the way, but I'm not finding a suitable example in the comments on php.net.