diff options
author | Urban Müller | 2015-10-30 15:37:17 +0100 |
---|---|---|
committer | Urban Müller | 2015-10-30 15:39:23 +0100 |
commit | da71e326d6bbd7e531f0948cac99cf0c4d51ad6e (patch) | |
tree | ae5c0061e50e620d3171a4f2d95956bf43864586 /it.class | |
parent | d908cb0d4e147721970c7eff5bd24f112bdac4cd (diff) | |
download | itools-da71e326d6bbd7e531f0948cac99cf0c4d51ad6e.tar.gz itools-da71e326d6bbd7e531f0948cac99cf0c4d51ad6e.tar.bz2 itools-da71e326d6bbd7e531f0948cac99cf0c4d51ad6e.zip |
minimal it::sort
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; +} + } -?> |