I am trying to have a nested array structure inside an ini settings file. The structure i have is:
stuct1[123][a] = \"1\"
stuct1[123][b] = \"2\"
stuct1[123][
You can use the sections feature of parse_ini_file
for this task.
Be sure to set your second parameter to true
:
parse_ini_file("sample.ini", true);
It's not exactly possible to make sub sections but you can make an indexed sub array like this:
[123]
setting[] = "1"
setting[] = "2"
setting[] = "3"
setting[] = "4"
Parsed it would look similar like thos
[123][setting][0] => "1"
[123][setting][1] => "2"
[123][setting][2] => "3"
[123][setting][3] => "4"