src/Panda/Support/Helpers/ArrayHelper.php
public static function sortByKey($array, $key, $useDotSyntax = false)
    {
        uasort($array, function ($a, $b) use ($key, $useDotSyntax) {
            $valueA = self::get($a, $key, null, $useDotSyntax);
            $valueB = self::get($b, $key, null, $useDotSyntax);
            if ($valueA == $valueB) {
                return 0;
            }

            return ($valueA < $valueB) ? -1 : 1;
        });

        return $array;
    }
public static function sortByKey($array, $key, $useDotSyntax = false)
    {
        uasort($array, function ($a, $b) use ($key, $useDotSyntax) {
            $valueA = self::get($a, $key, null, $useDotSyntax);
            $valueB = self::get($b, $key, null, $useDotSyntax);
            if ($valueA == $valueB) {
                return 0;
            }

            return ($valueA < $valueB) ? -1 : 1;
        });

        return $array;
    }
public static function sortByKey ( $ array , $ key , $ useDotSyntax = false ) { uasort ( $ array , function ( $ a , $ b ) use ( $ key , $ useDotSyntax ) { $ valueA = self :: get ( $ a , $ key , null , $ useDotSyntax ) ; $ valueB = self :: get ( $ b , $ key , null , $ useDotSyntax ) ; if ( $ valueA == $ valueB ) { return 0 ; } return ( $ valueA < $ valueB ) ? - 1 : 1 ; } ) ; return $ array ; }
Sort an array by a given value, based on the given key.

@param array  $array
@param string $key
@param bool   $useDotSyntax

@return array
Sort an array by a given value based on the given key .