<?php
include('inifile.php');
// Create a new object to manipulate example.ini
$ini = new IniFile("example.ini");
// In this example I want to use the Windows convention
// for line separation (\n\r)
$ini->setLineSeparator("\r\n");
// Get current date and time
$x = getdate();
// Add/change values in .ini file
$ini->setValue("","outside","true");
$ini->setValue("main","user","hugo");
$ini->setValue("main","password","");
$ini->setValue("options","width",800);
$ini->setValue("options","last_visit",$x['mday'].'/'.$x['mon'].'/'.$x['year'].' '.$x['hours'].':'.$x['minutes'].':'.$x['seconds']);
// Update/create file
echo $ini->writeFile();
?>
|