sort array by length php code example
Example: php sort array by value length
function sortByLength($a,$b){
return strlen($b)-strlen($a);
}
usort($array,'sortByLength');
function sortByLength($a,$b){
return strlen($b)-strlen($a);
}
usort($array,'sortByLength');