PHP code example of slince / config

1. Go to this page and download the library: Download slince/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/ */

    

slince / config example snippets


$config = new Slince\Config\Config();

$config->load('/path/to/config.json');

$config->load('/path/to/config-directory/');

$config->get('foo');

//Or access the data like array
$config['foo']['bar'];

echo $config->exists('foo');

//or like array
echo isset($config['foo']);

$config->set('bar', 'baz');

//or like array
$config['bar'] = 'baz';

$config->delete('bar');

//or like array
unset($config['bar']);

$config->clear();

$config->dump('/path/to/config-dump.php');