Use the reference operator to get the successive existing arrays:
$temp = &$data;
foreach($exploded as $key) {
$temp = &$temp[$key];
}
$temp = $value;
unset($temp);
More Related Contents:
- How to create tables from array in php
- multiple assigning array in foreach?
- remove duplicate key array from php [duplicate]
- Delete/unset an array element matching a key/value of another array element [PHP]
- PHP sort array by date and character
- Deleting an element from an array in PHP
- Transposing multidimensional arrays in PHP
- How to “flatten” a multi-dimensional array to simple one in PHP? [duplicate]
- How do you reindex an array in PHP but with indexes starting from 1?
- Sort an Array by keys based on another Array?
- PHP foreach change original array values [duplicate]
- Passing arrays as url parameter
- Turning multidimensional array into one-dimensional array [duplicate]
- I have an array of integers, how do I use each one in a mysql query (in php)? [duplicate]
- Replace keys in an array based on another lookup/mapping array
- Strange behavior of foreach when using reference: foreach ($a as &$v) { … }
- Get min and max value in PHP Array
- How get all values in a column using PHP?
- getting a checkbox array value from POST
- how to pass an array in GET in PHP?
- Sort array in PHP by value and maintain index association
- What is the maximum size of an array in PHP?
- Array to Object and Object to Array in PHP – interesting behaviour
- Merge two flat indexed arrays of equal size so that values are pushed into the result in an alternating fashion
- Fastest way of deleting a value in a comma separated list
- How to access first level keys of a 2d array with a foreach loop? [duplicate]
- Group multidimensional array data based on two column values and sum values of one column in each group
- Difference between array_push() and $array[] =
- PHP tree structure for categories and sub categories without looping a query
- Flat PHP Array to Hierarchy Tree