Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Josiel Alves  >  File INI  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example of use the class
Class: File INI
Manipulate configuration values in INI files
Author: By
Last change: The file is commented
Date: 2010-10-15 04:37
Size: 712 bytes
 

Contents

Class file image Download
<?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/>";
?>