PHP Classes

File: sample.ini

Recommend this page to a friend!
  Classes of Chris Sprucefield   Advanced INI file   sample.ini   Download  
File: sample.ini
Role: Example script
Content type: text/plain
Description: Sample ini file
Class: Advanced INI file
Read and parse INI files with multiple levels
Author: By
Last change:
Date: 7 years ago
Size: 719 bytes


Class file image Download
; This is a sample ini file that will be read by the script
; demo.php

#define A 10
#define B 20
#iniset some_var 10
; #include myOtherFile.ini

root = "/my/root/dir"

; Some normal definition as per standard ini files.
; This will create $conf['SQL']['....']
    host = "localhost"
    user = "root"
    pass = "foobar"
    db = "abc"

; Now, lets define a multilevel entry.
; You are not limited to 3 levels.. you can add any number of levels.
[Email : server]
    host = ""
    user = "test"

; Now, let's go for some dot notation variables.
Client.Email.Name = "foo"
Client.Email.Address = ""

; Ok. What about variable substitution?
Log.smtp = "{root}/smtp.log"