PHP Classes

File: example.php

Recommend this page to a friend!
  Packages of Dirk Herling   iniRW   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: iniRW
INI-File management
Author: By
Last change:
Date: 23 years ago
Size: 928 bytes
 

Contents

Class file image Download
<?php
  require ( "inirw.class.php");
  $ini = new iniRW ();

  $ini->write ( "example.ini", "example", "testitem" , "This is an example!!!");
  $ini->write ( "example.ini", "example", "testitem2", "This is an other example!!!");
  $ini->write ( "example.ini", "test"   , "testitem" , "TEST example");

  $all = $ini->read_all ( "example.ini", "example");
  print_r($all);
    // $all["EXAMPLE"]["testitem"] = "This is an example!!!";
    // $all["EXAMPLE"]["testitem2"] = "This is an other example!!!";
    // $all["TEST"]["testitem"] = "TEST example";

  $section = $ini->read_section ( "example.ini", "example"); // get section values
  print_r($section);
    // $section["testitem"] = "This is an example!!!";
    // $section["testitem2"] = "This is an other example!!!";

  $item = $ini->read_item ( "example.ini", "test", "testitem"); // get item value
  echo $item;
    // $item = "TEST example";
?>