PHP code example of apolinux / config
1. Go to this page and download the library: Download apolinux/config library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
apolinux / config example snippets
// file called config.php
return [
'item1' => 'value1' ,
'item2' => [
'item3 => 'value2',
],
..
];
Config::init(__DIR__) ;
echo Config::get('myconfig.item.item2.item3.item4');
// it shows 'http://uno'
echo Config::get('myconfig.list');
// shows 'blablabla'
echo Config::set('myconfig.list','otherlist');
// set only in memory 'otherlist' in 'list' key from myconfig.php file