Say I have this as a PHP array
$my = array('Google','Api','Key');
How can I create a nested array so it ends up like this
$new = array('Google'=>array('Api'=>array('key'=>'Some Value');
It needs to be dynamic as I will have no idea how many elements $my holds.
I have spent 8 hours trying and failed any help would be appreciated.
I have edited this as I need the final element in the $my array to have a value set. How would I do this.
Thanks