PHP code example of viloveul / config

1. Go to this page and download the library: Download viloveul/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/ */

    

viloveul / config example snippets




$config = new Viloveul\Config\Configuration([
	'key' => 'value'
]);
$config->setFoo('bar');
$config->bar = 'baz';
$config['main'] = 'item';

$otherConfig = Viloveul\Config\ConfigFactory::load('/path/to/your/config/file.php');

$anotherConfig = new Viloveul\Config\Configuration([
	'hello' => 'world'
]);

$otherAnotherConfig = new Viloveul\Config\Configuration([
	'key' => 'dor'
]);

$anotherOtherAnotherConfig = new Viloveul\Config\Configuration([
	'foo' => 'ssstttt'
]);

$config->merge($otherConfig);
$config->merge($anotherConfig);
$config->merge($anotherConfig, false);
$config->merge($anotherOtherAnotherConfig, true);

var_dump($config->all());