Login   Register  
PHP Classes
elePHPant
Icontem

File: demo.inifile.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jan Hüffelmann  >  inifile_1_2  >  demo.inifile.php  >  Download  
File: demo.inifile.php
Role: Example script
Content type: text/plain
Description: Class demo
Class: inifile_1_2
Windows inifile-handler read+write
Author: By
Last change: debugged
Date: 2002-08-09 09:05
Size: 1,004 bytes
 

Contents

Class file image Download
<?
require('class.inifile.inc');
if (
$ini = new inifile('demo.ini',TRUE))
  {
  
$ini->set_key('Demo','Last Run',date('d.m.Y,H:i:s'));
  
$ini->set_key('Demo','Background',"gray");
  
$ini->set_key('Demo','Font',"'courier new',courier,monospace");
  
$ini->set_key('Demo','FSize',"12px");
  
$ini->set_key('Demo','Color',"silver");
  
$ini->set_key('TMPSECTION','TMPVALUE',date('d.m.Y,H:i:s'));
  print 
"<pre>\n".$ini->listall()."</pre>\n";
  
$ini->del_key('TMPSECTION','TMPVALUE');
  
$ini->del_sec('TMPSECTION');
  print 
"<html>\n\t<head>\n\t\t<title>PHP inifile Demo</title>\n\t";
  
$bg $ini->get_key("Demo","Background","white");
  
$fg $ini->get_key("Demo","Color","Black");
  
$ft $ini->get_key("Demo","Font","Times");
  
$fs $ini->get_key("Demo","FSize","Times");
  print 
"<body style=\"fontweight:bold;background:".$bg.";font:".$ft.";font-size:".$fs.";color:".$fg.";\">\n";
  print 
"\t\t<pre>\n";
  print 
$ini->listall()."\n";
  print 
"\t\t</pre>\n\t</body>\n</html>";
  }
?>