note 93148 added to function.parse-ini-file

From: Date: Tue, 25 Aug 2009 17:23:46 +0000
Subject: note 93148 added to function.parse-ini-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-159885@lists.php.net to get a copy of this message
Make sure you use double-quotes when using spaces in a value as of 5.3. Consider the following INI file: key = tested on php5 with the following code: $res = parse_ini_file('myini.ini'); var_dump($res); In 5.2, this will give you: array(1) { ["key"]=> string(14) "tested on php5" } In 5.3, this will give you: Warning: syntax error, unexpected BOOL_TRUE in Unknown on line 1 in test.php on line 3 bool(false) This is because the 'on' word is a reserved keyword for boolean TRUE. The documentation now states that a string that contains any non-alphanumeric character should be enclosed in double-quotes (a space is not alphanumeric). ---- Server IP: 72.55.140.6 Probable Submitter: 206.162.145.2 ---- Manual Page -- http://www.php.net/manual/en/function.parse-ini-file.php Edit -- https://master.php.net/note/edit/93148 Del: integrated -- https://master.php.net/note/delete/93148/integrated Del: useless -- https://master.php.net/note/delete/93148/useless Del: bad code -- https://master.php.net/note/delete/93148/bad+code Del: spam -- https://master.php.net/note/delete/93148/spam Del: non-english -- https://master.php.net/note/delete/93148/non-english Del: in docs -- https://master.php.net/note/delete/93148/in+docs Del: other reasons-- https://master.php.net/note/delete/93148 Reject -- https://master.php.net/note/reject/93148 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#159885) next »