protected function sortArray(&$array, $sort_flags = SORT_REGULAR)
    {
        if (! is_array($array)) {
            return;
        }

        ksort($array, $sort_flags);

        foreach ($array as &$arr) {
            $this->sortArray($arr, $sort_flags);
        }
    }
protected function sortArray(&$array, $sort_flags = SORT_REGULAR)
    {
        if (! is_array($array)) {
            return;
        }

        ksort($array, $sort_flags);

        foreach ($array as &$arr) {
            $this->sortArray($arr, $sort_flags);
        }
    }
protected function sortArray ( & $ array , $ sort_flags = SORT_REGULAR ) { if ( ! is_array ( $ array ) ) { return ; } ksort ( $ array , $ sort_flags ) ; foreach ( $ array as & $ arr ) { $ this -> sortArray ( $ arr , $ sort_flags ) ; } }
Recursive ksort function to sort array.

See: https://gist.github.com/cdzombak/601849

@param  array  $array
@return void
Recursive ksort function to sort array .