|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-03-15 10:33 UTC] VJTD3 at VJTD3 dot com
Description:
------------
if a ini file has a "(" or ")" in it the parse_ini_file function will end on the character before the "(" or ")". in some cases or remove the "(" and ")" or just dump everything between the "(" and ")".
In a nut shell it hates "(" and ")" for some reason.
Reproduce code:
---------------
sample "demo.ini" file:
[demo]
a=1
b=(
c=3
php -r "print_r(parse_ini_file('demo.ini', true));"
Expected result:
----------------
Array
(
[demo] => Array
(
[a] => 1
[b] => (
[c] => 3
)
)
Actual result:
--------------
Warning: Error parsing demo.ini on line 3
Array
(
[demo] => Array
(
[a] => 1
[b] =>
)
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Feb 13 20:00:01 2026 UTC |
Says the documentation: "Note: If a value in the ini file contains any non-alphanumeric characters it needs to be enclosed in double-quotes (")." "... Characters {}|&~![()" must not be used anywhere in the key and have a special meaning in the value."