Today I ran into a parse error while trying to read in a .ini file I created.
The value of the line in error had a single quote in it…
Odd.
Off to php.net to look up what are the valid characters for a value in a .ini file.
Here’s what I found for parse_ini_file
Characters ?{}|&~![()^” must not be used anywhere in the key and have a special meaning in the value.
Special meaning… Ok, what exactly is the special meaning, I could not find it documented anywhere, but I did find something that helped me in a PHP bug report.
I did not want the “special meaning” to have any special meaning so I placed them inside single quotes. But lo and behold I also had a single quote. I just escaped the single quote (”’) and all was good.
Hope this helps