1. Go to this page and download the library: Download time2split/time2configure 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/ */
// Get a new configuration instance with an interpolator
$iconfig = Configurations::treeCopyOf($config, Interpolators::recursive());
$iconfig['interpolated'] = '${text.locale} and ${text.encoding}';
echo $iconfig['interpolated'], "\n";
$iconfig['text.locale'] = 'UTF-16';
echo $iconfig['interpolated'], "\n";
$default = [
'text' => [
'locale' => 'en_US',
'encoding' => 'UTF-8'
]
];
$default = Configurations::ofTree($default);
/*
$default is the config to search for
the unexistant entries of $config.
*/
$config = Configurations::emptyChild($default);
echo $config['text.locale'], "\n";
$config['text.locale'] = 'override';
echo $config['text.locale'], "\n";
$config['text.locale'] = null;
echo $config['text.locale'], "\n";
unset($config['text.locale']);
echo $config['text.locale'], "\n";