src/Common/Helper/ArrayHelper.php
public static function arraySortMulti(array &$aArray, $sField)
    {
        uasort($aArray, function ($a, $b) use ($sField) {

            $oA = (object) $a;
            $oB = (object) $b;

            $mA = property_exists($oA, $sField) ? strtolower($oA->$sField) : null;
            $mB = property_exists($oB, $sField) ? strtolower($oB->$sField) : null;

            //  Equal?
            if ($mA == $mB) {
                return 0;
            }

            //  If $mA is a prefix of $mB then $mA comes first
            if (preg_match('/^' . preg_quote($mA, '/') . '/', $mB)) {
                return -1;
            }

            //  Not equal, work out which takes precedence
            $aSort = [$mA, $mB];
            sort($aSort);

            return $aSort[0] == $mA ? -1 : 1;
        });
    }
public static function arraySortMulti(array &$aArray, $sField)
    {
        uasort($aArray, function ($a, $b) use ($sField) {

            $oA = (object) $a;
            $oB = (object) $b;

            $mA = property_exists($oA, $sField) ? strtolower($oA->$sField) : null;
            $mB = property_exists($oB, $sField) ? strtolower($oB->$sField) : null;

            //  Equal?
            if ($mA == $mB) {
                return 0;
            }

            //  If $mA is a prefix of $mB then $mA comes first
            if (preg_match('/^' . preg_quote($mA, '/') . '/', $mB)) {
                return -1;
            }

            //  Not equal, work out which takes precedence
            $aSort = [$mA, $mB];
            sort($aSort);

            return $aSort[0] == $mA ? -1 : 1;
        });
    }
public static function arraySortMulti ( array & $ aArray , $ sField ) { uasort ( $ aArray , function ( $ a , $ b ) use ( $ sField ) { $ oA = ( object ) $ a ; $ oB = ( object ) $ b ; $ mA = property_exists ( $ oA , $ sField ) ? strtolower ( $ oA -> $ sField ) : null ; $ mB = property_exists ( $ oB , $ sField ) ? strtolower ( $ oB -> $ sField ) : null ; //  Equal? if ( $ mA == $ mB ) { return 0 ; } //  If $mA is a prefix of $mB then $mA comes first if ( preg_match ( '/^' . preg_quote ( $ mA , '/' ) . '/' , $ mB ) ) { return - 1 ; } //  Not equal, work out which takes precedence $ aSort = [ $ mA , $ mB ] ; sort ( $ aSort ) ; return $ aSort [ 0 ] == $ mA ? - 1 : 1 ; } ) ; }
Sorts a multi dimensional array

@param array  &$aArray The array to sort
@param string  $sField The key to sort on
Sorts a multi dimensional array