Sort array by keys in ascending (low to high) order

array:sort_keys(ARRAY $array) : ARRAY

array:sort_keys(['b' => 1, 'a' => 2])
#=> [ "a" => 2, "b" => 1 ]

# note: because it is sorting by keys, it has no effect on arrays with ordered keys
array:sort_keys([3, 4, 1])
#=> [ 3, 4, 1 ]

array:sort_keys([])
#=> []

Copyright ©2013-2022 SunSed®. All rights reserved.