I am looking for a way to split a csv line into the keys of a multidimensional php array
a,b,c becomes
$some_array['a']['b']['c'] = true;
a,b,d,e becomes
$some_array['a']['b']['d']['e'] = true;
I am looking for a way to split a csv line into the keys of a multidimensional php array a,b,c becomes
a,b,d,e becomes
|
||||
add comment |
Maybe something like this?
The result for this test:
|
|||
|
$some_array['a']['b']['c']['d'] = true;
which means$some_array['a']['b']['c']
is an array. But then you will set$some_array['a']['b']['c']
to be boolean true - overwriting the contents of the first line. You will need to make sure all rows in your CSV have a fixed number of columns for your question to make sense. – Annabel Oct 13 '13 at 21:06