This is a recursive version of PHP's ksort function.
Created
September 28, 2010 21:43
-
-
Save cdzombak/601849 to your computer and use it in GitHub Desktop.
recursive ksort function for PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ksortRecursive(&$array, $sort_flags = SORT_REGULAR) { | |
if (!is_array($array)) return false; | |
ksort($array, $sort_flags); | |
foreach ($array as &$arr) { | |
ksortRecursive($arr, $sort_flags); | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment