PHP Classes

INI Files Handler: Read and manipulate INI files configuration values

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 515 All time: 5,735 This week: 62Up
Version License PHP version Categories
ini-files-handler 1.0.0GNU General Publi...3Files and Folders, Configuration
Description 

Author

This class can read and manipulate INI files configuration values.

It can parse an INI file or create a new file if it does not exist yet.

The class can get, set and delete configuration values in the INI file.

The changed configuration can be saved back to the INI file.

Picture of José Silva, Jr.
  Performance   Level  

 

Example

<?php

require_once 'classe.ini.php';

$ini = new ini('test.ini');
 
$ini->set('GROUP_A', 'VAR_X', 'MY_VALUE');
$ini->set('GROUP_A', 'VAR_Y', 'MY_OTHER_VALUE');
$ini->save();
 
if(
$ini->get('GROUP_A', 'VAR_X') != false)
   
$x = $ini->get('GROUP_A', 'VAR_X');
 
$ini->del('GROUP_A', 'VAR_X');
$ini->set('GROUP_B', 'VAR_X', 'OTHER_VALUE');
$ini->set('GROUP_B', 'VAR_Y', 'ANOTHER_VALUE');
$ini->save();

echo
'$x = ' . $x;
echo
'<script>window.open("test.ini", "_blank"); </script>';


  Files folder image Files (2)  
File Role Description
Plain text file classe.ini.php Class INI file handler Class
Accessible without login Plain text file ini_test.txt Example Usage exemple

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:515
This week:0
All time:5,735
This week:62Up