public static function assocSort(&$arr, $key, $type = SORT_STRING)
    {
        
        $ret = usort($arr, function ($a, $b) use ($key, $type)
        {
            switch ($type) {
                case SORT_STRING:
                    return strcasecmp($a[$key], $b[$key]);
                    break;
                
                case SORT_NUMERIC:
                    return $a[$key] > $b[$key];
                    break;
                
                default:
                    return 0;
            }
        });
        
        return $ret;
    }