Lets say i have this kind of code:
$array = [ \'a\'=> [ \'b\' => [ \'c\'=>\'some value\', ],
Easiest way to do this would be using set method from this library:
Arr::set($array, 'a.b.c', 'new_value');
alternatively if you have keys as array you can use this form:
Arr::set($array, ['a', 'b', 'c'], 'new_value');