PHP Classes

File: Example.config.php

Recommend this page to a friend!
  Classes of Yerfry Ramirez   Simple Configurations class   Example.config.php   Download  
File: Example.config.php
Role: Example script
Content type: text/plain
Description: A simple explanation of usage
Class: Simple Configurations class
Set and get configuration values in static vars
Author: By
Last change: None
Date: 8 years ago
Size: 513 bytes
 

Contents

Class file image Download
<?php

require 'config.class.php';

Configuration::set('MySQL', [
   
'Hostname' => '127.0.0.1',
   
'Username' => 'root',
   
'Password' => 'root',
   
'Database' => 'database'
]);

Configuration::set([
   
'Example1' => 'Value1',
   
'Example2' => 'Value2'
]);

Configuration::set('Test', 'Value');

print_r(Configuration::get('MySQL'));

echo
'<br />';

echo
Configuration::get('Example1');

echo
'<br />';

echo
Configuration::get('Example2');

echo
'<br />';

echo
Configuration::get('Test');
?>