php sort array by number characters in value 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');