PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Valentin  >  IDProperty  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: IDProperty
Retrieve values of properties defined in scripts
Author: By
Last change:
Date: 13 years ago
Size: 720 bytes


Class file image Download

//initialize class
require_once 'idproperty.class.php';
$prop= new IDProperty('./example_data/','cfg',true);

//example of getting variables
echo $prop->Get('file1','some_var_1','any "default" value here');
'<br />';
$prop->Get('file1','some_var_2',true); //<--- like this
echo '(this variable is false so you cant see it if you execute this example)<br />';
$prop->Get('file1','some_var_3',123); //<--- or like this
echo '<br />';

//another file
echo $prop->Get('file2','another_var',123); //<--- or like this
echo '<br />';

//getting non set variable
echo $prop->Get('file2','non_set_var','this variable isn\'t set');
'<br />';

//it's that easy! =)


For more information send a message to info at phpclasses dot org.