PHP Classes

File: examples.php

Recommend this page to a friend!
  Classes of Hadar Porat   HebCurrency   examples.php   Download  
File: examples.php
Role: Example script
Content type: text/plain
Description: Examples
Class: HebCurrency
Retrieve currency rates from the Bank Israel
Author: By
Last change:
Date: 18 years ago
Size: 562 bytes
 

Contents

Class file image Download
<?
// include the class
include_once('HebCurrency.php');

// English by default
$currenices = new HebCurrency();

// get USD currency
$dollars = $currenices -> getCurrency('USD');
print_r($dollars);

// covert 500 NIS to dollars
echo $currenices -> convertTo('USD', 500) . '<br />';

// covert 1000 EUR to NIS
echo $currenices -> convertFrom('EUR', 887) . '<br />';


// Hebrew names will replace English names
$currenices = new HebCurrency('he');

// get USD currency
$dollars = $currenices -> getCurrency('USD');
print_r($dollars);
?>