I have a line like this:
$string = 'one/two/three/four';
which I turn into an array:
$keys = explode('/', $string);
This array can have any number of elements, for example 1, 2, 5, etc.
How to assign a specific value to a multidimensional array, but use the $keys
created above to determine the position at which to insert?
how
$arr['one']['two']['three']['four'] = 'value';
Sorry if the question is confusing, but I do not know how to better explain it.
source share