PHP code example of exan / config
1. Go to this page and download the library: Download exan/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/ */
exan / config example snippets
/**
* -- src
* ---- config
* ------ database.php
* ---- index.php
*/
# src/config/database.php
return [
'host' => 'localhost',
'name' => 'my_database',
'port' => 1337,
];
# src/index.php
$config = new Exan\Config\Config(__DIR__ . '/config');
$config->get('database.host', 'my-default-value'); // 'localhost'