Location: PHPKode > scripts > Currency Exchange Rates with PHP & XML > readme.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="imagetoolbar" content="no">
<meta name="mssmarttagspreventparsing" content="true">
<title>Currency Exchange Read Me</title>
<style type="text/css">
a{
	color: blue;
}
body{
	background: #f7f7f7;
	color: #333;
	font: small Verdana, Arial, Helvetica, sans-serif;
	margin: 10px auto;
	padding: 0;
	width: 740px;
}
caption{
	font-weight: bold;
	padding-top: 1em;
	text-align: left;
}
h1{
	font-size: 160%;
}
h2{
	border-bottom: 1px solid #333;
	font-size: 120%;
	margin: 2em 0 0;
}
table{
	border: 1px solid #666;
	border-collapse: collapse;
}
th{
	white-space: nowrap;
}
th, td{
	border-bottom: 1px solid #666;
	padding: 5px 10px;
	text-align: left;
	vertical-align: top;
}
</style>
</head>
<body>
<h1>currencyexchange_class.php Read Me File </h1>
<p>Copyright (c) 2005, Gary White. See the file gpl.txt for details.<br>
Please report any bugs at <a href="/phptools/downloads/currencyexchange.zip">http://apptools.com/contact.php</a></p>
<p style="background:#fff;color:#000;padding: 8px;border:2px solid #f00"><strong>Important:</strong> The
	currency exchange rates are obtained from the European Central Band and are
	based on the regular daily concertation procedure between central banks within
	and outside the European System of Central Banks, which normally takes place
	at 2.15 p.m. ECB time (CET). The rates are believed to be accurate, however,
	the developer of this class assumes no responsibility for the accuracy of
	those rates. For more information on how the rates are developed, see <a href="http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html">Euro
	foreign exchange reference rates</a> at the European Central Bank web site. </p>
<table border="0" cellspacing="0" cellpadding="0">
	<caption>Files Included in this Archive</caption>
	<tr>
		<th>File Name</th>
		<th>Description</th>
	</tr>
	<tr>
		<td>currencyexchange_class.php</td>
		<td>The currencyExchange class file</td>
	</tr>
	<tr>
		<td>gpl.txt</td>
		<td>The General Public License</td>
	</tr>
	<tr>
		<td>readme.html</td>
		<td>This file</td>
	</tr>
	<tr>
		<td>sample.php</td>
		<td>A sample of how to use the class</td>
	</tr>
</table>
<h2>Installation</h2>
<p>Extract the files from this archive. The only file necessary for functionality
	is the currencyexchange_class.php file.</p>
<h2>Configuration</h2>
<p>None is required.</p>
<h2>Usage</h2>
<p>See the sample.php file included in the .zip file.</p>
<h2>Object Model</h2>
<table border="0" cellspacing="0" cellpadding="0">
	<caption>currencyExchange Object</caption>
	<tr>
		<th>Properties:</th>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<th>Name</th>
		<th>Type</th>
		<th>Read Only</th>
		<th>Description</th>
	</tr>
	<tr>
		<td>Date</td>
		<td>String</td>
		<td>Read only </td>
		<td>The date the conversion rates were posted by ECB in YYYY-MM-DD format.</td>
	</tr>
	<tr>
		<td>Error</td>
		<td>String</td>
		<td>Read only </td>
		<td>Description of last error encountered.</td>
	</tr>
	<tr>
		<td>Source</td>
		<td>String</td>
		<td>Read only </td>
		<td>Will be either &quot;Local&quot; or &quot;Remote&quot; depending on whether
			the data was obtained from the cached local copy or the remote XML file.</td>
	</tr>
	<tr>
		<td>Supplier</td>
		<td>String</td>
		<td>Read only </td>
		<td>If data is successfully obtained, this should be European Central Bank.</td>
	</tr>
	<tr>
		<td>localFile</td>
		<td>String</td>
		<td>Read/write</td>
		<td>The name and optionally a site root relative path to where the local cached
			copy of the remote XML file is to be stored.</td>
	</tr>
	<tr>
		<td>url</td>
		<td>String</td>
		<td>Read only </td>
		<td>The URL to the remote XML file at the European Central Bank web site.</td>
	</tr>
</table>
<p>Note that some properties are marked as read only. PHP does not have the capacity
	to actually make properties read only. The read only notation above is informational
	only. Attempting to assign a value to one of the read only properties will
	generate no error, however, after assigning a value to one of those properties
	will lead to unpredictable results. </p>
<table border="0" cellspacing="0" cellpadding="0">
	<tr>
		<th>Methods:</th>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<th>Name</th>
		<th>Parameters</th>
		<th>Return type</th>
		<th>Description</th>
	</tr>
	<tr>
		<td>getData</td>
		<td>None</td>
		<td>Integer</td>
		<td>Gets the data from the cached local file if available, or from the remote
			ECB file if newer. Returns the number of exchange rates in the XML file.</td>
	</tr>
	<tr>
		<td>Convert</td>
		<td>$from, $to, $amount </td>
		<td>Float</td>
		<td>Converts $amount from $from currency to $to currency and returns the result.
			The $from and $to parameters are the three letter identiers that represent
			the desired currencies. </td>
	</tr>
	<tr>
		<td>setBaseCurrency</td>
		<td>$currency</td>
		<td>Boolean</td>
		<td>The original rates in the XML file are based on conversion of other currencies
			to one Euro. You can change this to base the conversion on one unit
			of any of the other supported currencies. Note that this would only
			be useful if you are outputting a table of currency conversion rates. </td>
	</tr>
</table>
<p>The most recent version of the currencyExchange class is available at <a href="http://apptools.com/phptools/xml/currency/">http://apptools.com/phptools/xml/currency/</a></p>
</body>
</html>
Return current item: Currency Exchange Rates with PHP & XML