I've some difficulties creating a nested array by array of keys and assigning a value for the last nested item.
For example, lets $value = 4;
and $keys = ['a', 'b', 'c'];
The final result should be:
[
'a' => [
'b' => [
'c' => 4
]
]
]
I've tried with a recursion, but without success.
Any help would be greatly appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…