PHP code example of edwinhoksberg / settings
1. Go to this page and download the library: Download edwinhoksberg/settings 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/ */
edwinhoksberg / settings example snippets
// settings.php should just be a return statement with an array.
// See tests/fixtures/settings.php for an example.
Settings::loadFromFile('settings.php');
// Load from an array
Settings::loadFromArray([ 'settings' => ... ]);
// Get a setting value using dot notation
Settings::get('database.username', 'defaultuser');
// Retrieve the entire settings array
Settings::getAll();
// You can also set/replace settings with dot notation
Settings::set('database.password', 'toor');
// Check if a setting value exists
Settings::has('database.password'); // Returns true or false
// Remove all settings
Settings::clear();