Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $result = (function(array $values) {
- function _sort(array &$values)
- {
- ksort($values);
- $name = __FUNCTION__;
- foreach (array_keys($values) as $key) {
- if (is_array($values[$key])) {
- $name($values[$key]);
- }
- }
- }
- $result = $values;
- _sort($result);
- return $result;
- })([
- 'b' => [
- 'd' => 1,
- 'v' => 0,
- 'a' => [
- 'x' => 10,
- ],
- ],
- 'a' => [
- 'v' => 0,
- 'a' => [
- 'x' => 10,
- ],
- ]
- ]);
- print_r($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement