Consider this simple example array:
$letters = [
['a', 'c', 'f'],
['c', 'f'],
['b', 'd', 'x', 'c', 'f'],
['f']
];
I need to order the array in descending order by number of letters (or anyway, by the number of elements in each array item:
'b', 'd', 'x', 'c', 'f'
'a', 'c', 'f'
'c', 'f'
'f'
2
Answers
This should give you the result you are looking for:
The same in ‘2023 style’ ๐