The documentation on parse_ini_file states that you can't use these chars {}|&~
Daniel A. White
- 187,200
- 47
- 362
- 445

Martin
- 5,197
- 11
- 45
- 60
-
Any reason why keys would need these characters, especially &? – Tim Post Mar 29 '10 at 10:41
-
I hope you aren't doing this for security. – rook Mar 29 '10 at 21:55
2 Answers
20
The manual says those characters can not be used in the key -- the opposite of the value. To use them in values, double-quote the string.

Amy B
- 17,874
- 12
- 64
- 83
-
2"Characters {}|&~
VadimBelov
- 671
- 6
- 3
-
This can work if you happen to parse your own `.ini` file for your own usage. This will not cover the case where you change a `.ini` that is consumed by some other code (including the `.ini` that are read at PHP start). – Stéphane Gourichon Jun 26 '19 at 13:19