Avatar of tonelm54
tonelm54
 asked on

String to Array variable split

Ive been struggeling with an issue for a while of turning a string into an array, but a multi dimentinal array. So for example:-

$sett["Settings.General.View.Scheme"] = 12;
$sett["Settings.General.IDE.Color"] = 15;
$sett["Settings.General"] = "Allowed";
to turn into

$sett["Settings"].["General"].["View"].["Scheme"] = 12;
$sett["Settings"].["General"].["IDE"].["Color"] = 15;
$sett["Settings"].["General"] = "Allowed";

Ive played around trying to get it to work with functions and for loops but cant get it working. Any ideas or pointers?
PHP

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Julian Hansen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Julian Hansen

@tonelm54

Regarding your comment in the testimonial - I have added comments to the code in case you have not seen them, that explain how the code works.

If you are stuck - feel free to post back with questions.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy