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: 14 years ago
Size: 720 bytes
 

Contents

Class file image Download
<?php

//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');
    echo
'<br />';
    echo
$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 />';
    echo
$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');
    echo
'<br />';

//it's that easy! =)

?>