<?php
array('key111' => 'value111', 'key112' => 'value112',
'key113' => 'value113',
),
),
);
function getKeys($array, $prefix='', $separator = '/') {
foreach($array as $key => $value) {
if (!is_array($value)) $return[] = $prefix . $key; else $return = array_merge($return, getKeys
($value, $prefix . $key . $separator, $separator)); }
return $return;
}
$keys = getKeys($array, '', '#');
?>
PD9waHAKJGFycmF5ID0gYXJyYXkoJ2tleTEnID0+IAogICAgICAgICAgICAgICAgYXJyYXkoJ2tleTExJyA9PiAKICAgICAgICAgICAgICAgICAgICAgYXJyYXkoJ2tleTExMScgPT4gJ3ZhbHVlMTExJywgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICdrZXkxMTInID0+ICd2YWx1ZTExMicsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAna2V5MTEzJyA9PiAndmFsdWUxMTMnLAogICAgICAgICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICApOwoKZnVuY3Rpb24gZ2V0S2V5cygkYXJyYXksICRwcmVmaXg9JycsICRzZXBhcmF0b3IgPSAnLycpIHsKICAkcmV0dXJuID0gYXJyYXkoKTsKICBmb3JlYWNoKCRhcnJheSBhcyAka2V5ID0+ICR2YWx1ZSkgewogICAgaWYgKCFpc19hcnJheSgkdmFsdWUpKSAkcmV0dXJuW10gPSAkcHJlZml4IC4gJGtleTsKICAgIGVsc2UgJHJldHVybiA9IGFycmF5X21lcmdlKCRyZXR1cm4sIGdldEtleXMoJHZhbHVlLCAkcHJlZml4IC4gJGtleSAuICRzZXBhcmF0b3IsICRzZXBhcmF0b3IpKTsKICB9CiAgcmV0dXJuICRyZXR1cm47Cn0KCiRrZXlzID0gZ2V0S2V5cygkYXJyYXksICcnLCAnIycpOwoKcHJpbnRfcigka2V5cyk7Cj8+