note 39176 deleted from function.parse-ini-file by tomsommer
| From: | tomsommer@php.net | Date: | Mon, 09 Aug 2004 00:23:44 +0000 |
| Subject: | note 39176 deleted from function.parse-ini-file by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74266@lists.php.net to get a copy of this message | ||
Note Submitter: woodie@worldpac.com
----
When your keys use reserved words like ON or NO,
as in a dropdown with 'Ontario' and 'Norway' in it...
You can repalce this...
$options = parse_ini_file("options.ini");
With the following (using pear)...
require_once 'Config.php';
$config = new Config();
$source =& $config->parseConfig("options.ini", 'inicommented');
$parent = $source->toArray();
$options = $parent['root'];