Created
December 26, 2014 17:47
-
-
Save ryaan-anthony/25a6e598fe206eec01dd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| function array_walk_depth(array &$arr, $depth, $callback) | |
| { | |
| $depth--; | |
| foreach($arr as $key => &$val){ | |
| if($depth) array_walk_depth($val, $depth, $callback); | |
| else $callback($val); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment