PHP Classes
elePHPant
Icontem

File: Example.txt

Recommend this page to a friend!
  Classes of Chris Sprucefield  >  Advanced INI file  >  Example.txt  >  Download  
File: Example.txt
Role: Documentation
Content type: text/plain
Description: Examples
Class: Advanced INI file
Read and parse INI files with multiple levels
Author: By
Last change: New usage info.
Date: 3 years ago
Size: 718 bytes
 

Contents

Class file image Download
<?php

include_once "Ini.php" ;

$conf = Ini::parseFile("sample.ini") ;
print_r($conf) ;


// Write an array into an ini file that can be parsed.
Ini::write($filename,$arr)

// Read a config file into an array.
// If you pass xconf as an existing array, it will be merged to the data read in.
// nosub=1 prohibits variable substitution.

$conf = Ini::parseFile($file,$xconf = [], $nosub = 0)

// Get the value from an array, using dot notation instead of ['name1']['name2']['name3'],
// which can be substituted with:
$value = val("name1.name2.name3", $yourArray)

// if the second argument is not provided, the search will done from the last read config file.
$value = val("name1.name2.name3")