PHP code example of rogerthomas84 / php-config-dot-notation
1. Go to this page and download the library: Download rogerthomas84/php-config-dot-notation 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/ */
rogerthomas84 / php-config-dot-notation example snippets
$config = [
'app' => [
'name' => 'Foo Bar',
'version' => 1
]
];
\ConfigDot\Config::setConfig($config);
// set the config as above
$appName = \ConfigDot\Config::get('app.name');
// $appName = string(7) "Foo Bar" (or null if it does not exist)
// set the config as above
if (\ConfigDot\Config::has('app.name')) {
// it does!
}
// set the config as above
\ConfigDot\Config::update('app.name', 'Wolf');