Location: PHPKode > scripts > File INI > example.php
<?php
//Includes the class file
require 'FileIni.class.php';
//Set the options
$options=array('autoSave'=>true, 'readOnly'=>false);
//Creates an object of the FileIni class
$file=new FileIni("examplefile.ini", $options);
//Set a value
$file->setValue('info', 'age', 15);
//Gets the keys from section 'other'
echo "Keys of section 'other':<br/>" . implode(', ', $file->getKeysFromSection('other')) . "<br/>";
//Prints the values from section 'other'
echo "Values of section 'other':<br/>" . implode(', ', $file->getValuesFromSection('other')) . "<br/>";
//prints the itens from section 'info'
echo "Itens of section 'info':<br/> " . implode(', ', $file->getItensFromSection('info')) . "<br/>";
?>
Return current item: File INI