PHP code example of joebengalen / config

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

    

joebengalen / config example snippets




stantiate the config object.
$config = new \JoeBengalen\Config\Config();

// Load a php config file info the config object.
$config->load(__DIR__ . DIRECTORY_SEPARATOR . 'config.php');

// Set some more configurations.
$config->set([
    'database.host' => '127.0.0.1',
    'database.user' => 'root',
]);

// Show an array of all database configurations
var_dump($config->get('database'));