Edit report at https://bugs.php.net/bug.php?id=64650&edit=1
ID: 64650 Updated by: [email protected] Reported by: eduosi at 163 dot com Summary: parse_ini_file parse ini file -Status: Open +Status: Not a bug Type: Bug Package: Unknown/Other Function PHP Version: 5.3Git-2013-04-15 (Git) Block user comment: N Private report: N New Comment: .... and it's clearly documented here http://de2.php.net/parse_ini_file [quote] Note: If a value in the ini file contains any non-alphanumeric characters it needs to be enclosed in double-quotes ("). [/quote] Previous Comments: ------------------------------------------------------------------------ [2013-04-15 17:10:08] [email protected] The current ini_parser implementations with INI_SCANNER_RAW only works with double quotes as string delimiter. ------------------------------------------------------------------------ [2013-04-15 09:52:22] eduosi at 163 dot com Description: ------------ Dearï¼ php version 5.3.0 or greater 5.3.0ï¼ parse_ini_file() loads in the ini file specified in file, if param $scanner_mode equal 'INI_SCANNER_RAW' and option value contain ';', this value will be truncated. Test script: --------------- ====== ini file ====== simple.ini [db] connectionString='mysql:dbname=db;host=127.0.0.1' username='root' passwrd='' ====== php script ====== <?php var_dump(parse_ini_file('simple.ini', TRUE, INI_SCANNER_RAW)); ====== result ====== array(1) { ["db"]=> array(3) { ["connectionString"]=> string(17) "'mysql:dbname=db" ["username"]=> string(6) "'root'" ["password"]=> string(2) "''" } } ====== I expect results ====== array(1) { ["db"]=> array(3) { ["connectionString"]=> string(17) "'mysql:dbname=db;host=127.0.0.1'" ["username"]=> string(6) "'root'" ["password"]=> string(2) "''" } } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64650&edit=1
