protected function sortJson(&$array)
    {
        foreach ($array as &$value) {
            if (is_array($value) && isset($value[0])) {
                sort($value);
            } elseif (is_array($value)) {
                $this->sortJson($value);
            }
        }

        return ksort($array);
    }
protected function sortJson(&$array)
    {
        foreach ($array as &$value) {
            if (is_array($value) && isset($value[0])) {
                sort($value);
            } elseif (is_array($value)) {
                $this->sortJson($value);
            }
        }

        return ksort($array);
    }
protected function sortJson ( & $ array ) { foreach ( $ array as & $ value ) { if ( is_array ( $ value ) && isset ( $ value [ 0 ] ) ) { sort ( $ value ) ; } elseif ( is_array ( $ value ) ) { $ this -> sortJson ( $ value ) ; } } return ksort ( $ array ) ; }
Sort a JSON response, for easy assertions and comparisons.

@param  array &$array
@return array
Sort a JSON response for easy assertions and comparisons .