note 84886 deleted from function.parse-ini-file by cmb
| From: | cmb@php.net | Date: | Sun, 02 Dec 2018 12:48:06 +0000 |
| Subject: | note 84886 deleted from function.parse-ini-file by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209825@lists.php.net to get a copy of this message | ||
Note Submitter: david dot dyess at gmail dot com
----
Here is another way to group values in the ini:
my.ini:
[singles]
test = a test
test2 = another test
test3 = this is a test too
[multiples]
tests[] = a test
tests[] = another test
tests[] = this is a test too
my.php:
<?php $init = parse_ini_file('my.ini'); ?>
The same as:
<?php
$init['test'] = 'a test';
$init['test2'] = 'another test';
$init['test3'] = 'this is a test too';
$init['tests'][0] = 'a test';
$init['tests'][1] = 'another test';
$init['tests'][2] = 'this is a test too';
?>
This works with the bool set to true also, can be useful with loops. Works with the bool set to true
as well.