diff options
author | Simon Rettberg | 2022-05-02 17:54:40 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-05-02 17:54:40 +0200 |
commit | 890ec384849330b3d87e31871060fbf477197ff1 (patch) | |
tree | c2359160b2251038d244da4dff2f2e334deb6ee8 /inc | |
parent | [rebootcontrol] Show location for automated WOL test tasks (diff) | |
download | slx-admin-890ec384849330b3d87e31871060fbf477197ff1.tar.gz slx-admin-890ec384849330b3d87e31871060fbf477197ff1.tar.xz slx-admin-890ec384849330b3d87e31871060fbf477197ff1.zip |
[rebootcontrol] Show time of execution for WOL/reboot/shutdown
Diffstat (limited to 'inc')
-rw-r--r-- | inc/arrayutil.inc.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/inc/arrayutil.inc.php b/inc/arrayutil.inc.php index c1306ac7..3beceb41 100644 --- a/inc/arrayutil.inc.php +++ b/inc/arrayutil.inc.php @@ -36,4 +36,16 @@ class ArrayUtil return $out; } + /** + * Sort array by given column. + * @param array $array + * @param string $column + * @return void + */ + public static function sortByColumn(array &$array, string $column, int $sortFlags = SORT_REGULAR) + { + $sorter = array_column($array, $column); + array_multisort($sorter, $sortFlags, $array); + } + }
\ No newline at end of file |