PHP code example of aedart / config

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

    

aedart / config example snippets




use Aedart\Config\Parsers\ReferenceParser;
use Illuminate\Config\Repository;

// Given the following array
$items = [
    'db.driver'         => '{{defaults.driver}}',
    'defaults.driver'   => 'abc'
];
 
// When it is parsed
$repo   = new Repository($items);
$config = (new ReferenceParser())->parse($repo);
 
// The 'db.driver' key is parsed to the value of 'defaults.driver'
echo $config->get('db.driver'); // output 'abc'