PHP Classes
Icontem

File: index.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Cristian Navalici  >  XML Currency Reader  >  index.php  
File: index.php
Role: Example script
Content type: text/plain
Description: Short example of usage.
Class: XML Currency Reader
Retrieve currency exchange data from XML files
 

Contents

Class file image Download
<?php

require_once('XML_currency_reader.class.php');
require_once(
'BNR_reader.class.php');

// create an object
$bnrob = new BNR_reader();

// parse the content
$content $bnrob->parse_xml();

// display the rate for USD
echo 'First method: raw array display <br />';
echo 
'Exchange Rate for 1 USD is : ' .$content[2][18]['rate'] .'<br /><br />';

// or use the class method
$ret_arr $bnrob->parse_rate_contents($content[2], 'USD');
echo 
'Second method: parse_rate_contents() <br />';
echo 
'Exchange Rate for 1 USD is : ' .$ret_arr['rate'] .'<br />';

// debug
echo '<pre>' .print_r($contenttrue).'</pre>';



?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products