开发者

PHP: Escape illegal chars in .ini-files

开发者 https://www.devze.com 2022-12-24 06:24 出处:网络
The documentation on parse_ini_file states that you can\'t use these chars {}|&am开发者_JS百科p;~![()^\" in the value. Is there some way to escape these chars? I need to use them. Normal escaping with

The documentation on parse_ini_file states that you can't use these chars {}|&am开发者_JS百科p;~![()^" in the value. Is there some way to escape these chars? I need to use them. Normal escaping with \ doesn't seem to work.


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.


Try using INI_SCANNER_RAW (from the same documentation) for scanner_mode:

parse_ini_file ( $filename, true, INI_SCANNER_RAW );
0

精彩评论

暂无评论...
验证码 换一张
取 消