Skip to content

Instantly share code, notes, and snippets.

@spolischook
Last active December 19, 2015 00:29
Show Gist options
  • Save spolischook/5869458 to your computer and use it in GitHub Desktop.
Save spolischook/5869458 to your computer and use it in GitHub Desktop.
<?php
class KsortRecursive
{
protected function ksortRecursive(array $array)
{
foreach ($array as $key => $nestedArray) {
if (is_array($nestedArray) && !empty($nestedArray)) {
$array[$key] = $this->ksortRecursive($nestedArray);
}
}
ksort($array);
return $array;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment