1. Go to this page and download the library: Download rik72/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/ */
rik72 / 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');
// setting a comment (in the line preceding the parameter) - the leading ';'
// can be omitted or i2 = 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');