1. Go to this page and download the library: Download jelix/inifile 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/ */
jelix / inifile example snippets
$ini = new \Jelix\IniFile\IniModifier('myfile.ini');
// setting a parameter. (section_name is optional)
$ini->setValue('parameter_name', 'value', 'section_name');
// retrieve a parameter value. (section_name is optional)
$val = $ini->getValue('parameter_name', 'section_name');
// remove a parameter
$ini->removeValue('parameter_name', 'section_name');
// save into file
$ini->save();
$ini->saveAs('otherfile.ini');
// importing an ini file into an other
$ini2 = new \Jelix\IniFile\IniModifier('myfile2.ini');
$ini->import($ini2);
$ini->save();
// merging two section: merge sectionSource into sectionTarget and then
// sectionSource is removed
$ini->mergeSection('sectionSource', 'sectionTarget');