note 75976 deleted from function.array-keys by danbrown
| From: | danbrown@php.net | Date: | Wed, 25 Aug 2010 01:46:08 +0000 |
| Subject: | note 75976 deleted from function.array-keys by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172004@lists.php.net to get a copy of this message | ||
Note Submitter: linus dot norton at assertis dot co dot uk
----
RE: creator at mindcreations
I found that with my php (5.1.2) I needed to initialize $keys
function multiarray_keys($ar) {
$keys = array();
foreach($ar as $k => $v) {
$keys[] = $k;
if (is_array($ar[$k]))
$keys = array_merge($keys, multiarray_keys($ar[$k]));
}
return $keys;
}