- var_dump: documentation ( source)
- mb_strlen: documentation ( source)
- usort: documentation ( source)
<?php
$v =
[
'aaaa',
'bbbb',
'ccccccc',
'dddddddddd',
'eeeeeeee',
'ffffffffffff',
'gggg',
'hhhhhh',
'iiiiiiiiiii',
'lllllll',
'mmmmmmmmmmm',
'nnnnnnn',
'ooo',
];
usort($v, function($a, $b){ return mb_strlen($b) <=> mb_strlen($a); });
var_dump($v);