PHP code example of superruzafa / settings-loader
1. Go to this page and download the library: Download superruzafa/settings-loader 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/ */
superruzafa / settings-loader example snippets php
use \DomDocument;
use Superruzafa\Settings\Loader\XmlLoader;
$doc = new DomDocument();
$doc->load(__DIR__ . '/settings.xml');
$loader = new XmlLoader($doc);
$loader->load();
$settings = $loader->getSettings();
// $settings = array(
// array(
// 'country' => 'Japan',
// 'company' => 'Nintendo',
// ),
// array(
// 'country' => 'Japan',
// 'company' => 'Sony',
// )
// )
xml
<s:settings language="PHP" purpose="Web and more" />
xml
<s:settings language="PHP">
<language>PHP</language>
</s:settings>
php
// array(
// array('colors' => array('red', 'green', 'blue'))
// )
php
// array(
// array('colors' => array('black', 'white')),
// array('colors' => array('red', 'green', 'blue'))
// array('colors' => 'transparent')
// )
php
// array(
// 'language' => 'PHP',
// 'string' => 'I like PHP',
// )
php
// array(
// 'who' => 'I',
// 'language' => 'PHP',
// 'string' => 'I like PHP so much!',
// 'preference' => 'like',
// )
php
// array(
// array (
// 'string' => 'My name is ',
// )
// )
php
// array(
// array (
// 'key1' => 'Need Need Need ',
// 'key2' => 'Need Need ',
// 'key3' => 'Need ',
// )
// )
php
// array(
// array (
// 'seasons' => array('Spring','Summer','Autumn','Winter'),
// 'year' => 'A year is composed by <array>',
// )
// )