public static function sortWords(array &$arr)
    {
        ksort($arr);
        foreach ($arr as &$wordsByLen) {
            ksort($wordsByLen);
            foreach ($wordsByLen as &$words) {
                sort($words, SORT_STRING);
            }
        }

        return $arr;
    }
public static function sortWords(array &$arr)
    {
        ksort($arr);
        foreach ($arr as &$wordsByLen) {
            ksort($wordsByLen);
            foreach ($wordsByLen as &$words) {
                sort($words, SORT_STRING);
            }
        }

        return $arr;
    }
public static function sortWords ( array & $ arr ) { ksort ( $ arr ) ; foreach ( $ arr as & $ wordsByLen ) { ksort ( $ wordsByLen ) ; foreach ( $ wordsByLen as & $ words ) { sort ( $ words , SORT_STRING ) ; } } return $ arr ; }
Sorts an array of words.

@param array $arr

@return array
Sorts an array of words .