1. Go to this page and download the library: Download davidlienhard/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/ */
davidlienhard / config example snippets
declare(strict_types=1);
use DavidLienhard\Config\Config;
try {
$config = new Config("path/to/config");
} catch (\Throwable $t) {
echo "unable to setup config";
exit(1);
}
declare(strict_types=1);
echo $config->getAsString("system", "name");
/*
if the value exists and is not an array, it will return a string in any case
if the value is an array, this will throw an exception
if the value does not exist this will return null
*/