diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1030,5 +1030,12 @@ static function json_decode($json) return ($data = json_decode($json)) === null && $json != 'null' ? it::error(array('title' => "invalid json", 'body' => $json)) : $data; } +static function sort($array, $mode = "") +{ + $func = it::replace(array('n' => ""), count_chars($mode, 3)) . "sort"; # count_chars sorts flags + $func($array, it::match('n', $mode) ? SORT_NUMERIC : 0); + + return $array; +} + } -?> |