Answers for "php sort array by value length"

PHP
0

php sort array by value length

function sortByLength($a,$b){
    return strlen($b)-strlen($a);
}
usort($array,'sortByLength');
Posted by: Guest on September-23-2020

Code answers related to "php sort array by value length"

Browse Popular Code Answers by Language