Skip to content

Instantly share code, notes, and snippets.

@cdzombak
Created September 28, 2010 21:43
Show Gist options
  • Save cdzombak/601849 to your computer and use it in GitHub Desktop.
Save cdzombak/601849 to your computer and use it in GitHub Desktop.
recursive ksort function for PHP
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