I thought about it a lot before posting this question.
The question is more conceptual than anything else.
Starting from a classic array, I want to dynamically transform it into multidinamic with subtrees.
to be clear, from this:
$array = ['my', 'unique', 'values', 'array', 'and', 'so', 'on', '...'];
to this:
Array
(
['my'] =>
['unique'] =>
['values'] =>
['array'] =>
['and'] =>
['so'] =>
['on']=>
['...'] => []
)
The only attempt I made was "barbarously" to dynamically create strings and pass them with the eval()
command.
I don't write the code here for personal dignity. It's bad enough I confessed it. Insiders will understand...
I fully believe that there is a correct way to do it, but of course, if I'm here, I don't know it
Best
Oscar