Good day!
There is a set of words. For example: "London Paris London Moscow Paris London Kiev Paris London Kiev".
It is necessary to get the result in decreasing order:
London - 4
Paris - 3
Kiev - 2
Moscow - 1
I was able to cope with the task partially (and even then not quite))):
$str = 'Лондон Париж Лондон Москва Париж Лондон Киев Париж Лондон Киев'; echo substr_count($str, 'Лондон').'<br>';
Tell me how to implement, if you do not know what the words will be and that the result was in decreasing order?