|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-06-02 04:13 UTC] dhendric at adobe dot com
Description: ------------ --- From manual page: http://www.php.net/function.parse-ini-file#Description --- Using parse_ini_file() on a ini files that contain parens () in the property values throws and error. Example of Test.ini file: #S7Z OK #Wed Jun 01 18:58:52 PDT 2011 copyright=Copyright (c) 2001-2010 Adobe Systems Incorporated. All rights reserved. imageServer.buildDate=Mon Apr 25 02:18:36 PDT 2011 imageServer.startTime=Mon Apr 25 16:10:52 PDT 2011 imageServer.version=4.9.2 Test script: --------------- print_r(parse_ini_file("Test.ini")); Expected result: ---------------- The parse_ini_file() should process any character in the property value else what good is it. Actual result: -------------- Warning: syntax error, unexpected '(' in Test.ini on line 3 in /opt/lampp/htdocs/working_deirdra/serverlist/serverlist_ajax.php on line 82 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 23:00:01 2025 UTC |
Quote free text like that. [david@oslo:~]$ cat t.php <?php $ini = <<<INI copyright="Copyright (c) 2001-2010 Adobe Systems Incorporated. All rights" INI; var_dump(parse_ini_string($ini)); [david@oslo:~]$ php t.php array(1) { ["copyright"]=> string(62) "Copyright (c) 2001-2010 Adobe Systems Incorporated. All rights" } [david@oslo:~]$