I am using this PHP Class to write ini files.
I use below code to update ini file;
<?php
include("class.iniparser.php");
$cfg = new iniParser("config.ini");
$cfg->setValue("Tool","version", "0.9beta");
$cfg->save();
?>
config.ini as below;
[Tool]
name = mein kleiner Parser
version = 0.9alpha
lastmodified = 2006-01-16
When I have a comment line (ex: #company = example.com), it will automatically delete it.
I want to update config.ini file without deleting comment lines
Is there a way to achieve it?
I have tried stackoverflow,
Config_Lite,
Piwik/Ini and PHP INI Read and Write Class
All are giving the same result
Appreciate your support