1. Go to this page and download the library: Download weew/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/ */
weew / config example snippets
$loader = new ConfigLoader();
$loader->addPath('path/to/my/config');
$config = $loader->load();
// get config value
$config->get('key', 'defaultValue');
// set config value
$config->set('key', 'value');
// check if config is set
$config->has('key');
// remove config value
$config->remove('key');
// check if config is set, throws MissingConfigException
// optionally a type may be specified (string, int, array, etc..)
$config
->ensure('key', 'errorMessage')
->ensure('stringNode', 'errorMessage', 'string')
->ensure('arrayNode', 'errorMessage', 'array');