sort by length of array element 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');