Answers for "php sort array by longest"

PHP
0

php sort array by longest

function sort($a,$b){
    return strlen($b)-strlen($a);
}

usort($array,'sort');
Posted by: Guest on October-07-2021

Browse Popular Code Answers by Language