PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Gianluca Zanferrari   INI handler   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example php file
Class: INI handler
Read and write configuration values to INI files
Author: By
Last change:
Date: 14 years ago
Size: 573 bytes
 

Contents

Class file image Download
<?php require_once('ini_handler.php');
$r = rand(1000000,5000000);
$ini = new ini_handler();
?>
<p>I read the value of "my_name" in "settings.ini': <?=$ini->ini_read('settings.ini','my_name');?></p>
<p>I write a new value to "bank account $" in "settings.ini": <? $ini->ini_write('settings.ini','bank account $',$r); echo($ini->ini_read('settings.ini','bank account $'));?></p>
<p>I remove the key "badkey" in "settings.ini" if it exists. <? $ini->ini_remove('settings.ini','badkey');?></p>
<p>Dump of "settings.ini":</p>
<?php
$ini
->ini_dump('settings.ini');
?>