Skip to content

Instantly share code, notes, and snippets.

@xrsrke
Created July 25, 2018 03:32
Show Gist options
  • Save xrsrke/d7c6dda6c06cea956082ad87ca4cee76 to your computer and use it in GitHub Desktop.
Save xrsrke/d7c6dda6c06cea956082ad87ca4cee76 to your computer and use it in GitHub Desktop.
function array_keys_multi(array $array)
{
$keys = array();
foreach ($array as $key => $value) {
$keys[] = $key;
if (is_array($value)) {
$keys = array_merge($keys, array_keys_multi($value));
}
}
return $keys;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment