Hi all. Have been racking my brains about how to go about creating a multidimensional array dynamically from an array of keys. Something like...
$keys = array('key1', 'key2', 'key3');
$value = 'some value';
// $md = ...???!!!...
I need the $md multidimensional array to have the keys thus...
$md['key1']['key2']['key3'] = $value;
Obviously that could be hardcoded quite easily, but my problem it that the $keys array is variable - it can hold different values and the number of items can vary. So how to build an md array? I'm looking for a generic routine.
I've come close a few times, but it's just beyond me. Any clues would be appreciated.