-
-
Save sany2k8/d1efd25f8a3ae4d223e59b5d758e4060 to your computer and use it in GitHub Desktop.
Get all keys from a multidimensional array From http://stackoverflow.com/questions/11234852/how-to-get-all-the-key-in-multi-dimensional-array-in-php
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_keys_multi(array $array) | |
| { | |
| $keys = array(); | |
| foreach ($array as $key => $value) { | |
| $keys[] = $key; | |
| if (is_array($array[$key])) { | |
| $keys = array_merge($keys, array_keys_multi($array[$key])); | |
| } | |
| } | |
| return $keys; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment