PHP code example of garoevans / config_loader

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

    

garoevans / config_loader example snippets


use Garoevans\ConfigLoader;

$config = ConfigLoader('config_directory', 'ini_file_name.ini');
$config->load();

// Gets the ini section called 'db' or returns an empty array
$config->get('db', array());

// Gets the value of 'host' from the 'db' section or returns an empty string
$config->get('db/host', '');