How does PHP read all the content of a node in the INI file? Suppose there is an ini file (aa. ini) with the following content:
[Aa]
AB = 12
Ac = 123
Ad = 1234
[Bb]
Bb = 22
Bc = 343
The items in [aa] and [bb] are not fixed. how can I read only the content of all nodes in [aa?
Thank you!
Reply to discussion (solution)
$ Tmp = parse_ini_file (INI file, true );
$ Aa = $ tmp ['A'];
If you are using php> = 5.4
$ Aa = $ tmp = parse_ini_file (INI file, true) ['A'];
$ Tmp = parse_ini_file (INI file, true );
$ Aa = $ tmp ['A'];
If echo $ aa; is added, why is it displayed as an Array instead of data?
If you are using php> = 5.4
$ Aa = $ tmp = parse_ini_file (INI file, true) ['A'];
Do I still need to use for loop acquisition?
Why don't you just use it?
Echo $ aa ['AB'];
No?
That's an array. echo is not acceptable.
$ Tmp = parse_ini_file (INI file, true );
$ Aa = $ tmp ['A'];
If echo $ aa; is added, why is it displayed as an Array instead of data?
Why don't you just use it?
Echo $ aa ['AB'];
No?
I want everything, not the content of a single branch. I want to read all the content in [aa], and AB, ac, and ad are unknown, not known.
You didn't meanHow can I read only the content of all nodes in [aa?
Foreach ($ aa as $ k =>$ v ){
// Do your operations here!
}
Foreach ($ aa as $ k =>$ v ){
// Do your operations here!
}
Can I make it clear? Thank you!