Location: PHPKode > scripts > Currency Exchange Rates with PHP & XML > sample.php
	This is a sample file that demonstrates the usage of the currencyExchange class.
	For purposes of this example, make certain that currencyexchange_class.php is 
	saved in the same directory as this file.
$cx=new currencyExchange();
<html lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="imagetoolbar" content="no">
<meta name="mssmarttagspreventparsing" content="true">
<meta http-equiv="MSThemeCompatible" content="No">
<title>Currency Conversion Example</title>
<style type="text/css">
	background-color: #eee;
	color: #333;
	font: small Verdana, Arial, Helvetica, sans-serif
	background-color: #f7f7f7;
	border:1px solid #000;
	margin: 50px auto;
	padding: 10px;
	width: 300px;
#pricebox h1, #pricebox h2, #pricebox p{
	margin: 0;
	padding: 0;
	text-align: center;
h1{font-size: 160%;}
h2{font-size: 140%;}
<div id="pricebox">
<h1>Get the New Widget</h1>
<h2>Price $250.00 U.S. dollars</h2>
if ($euro=$cx->Convert("USD","EUR",250)){
	echo "&euro;$euro Euros ";
if ($pound=$cx->Convert("USD","GBP",250)){
	echo "<br>\n&pound;$pound British Pounds</p>\n"
		."<p style=\"font-size:smaller;border-top: 1px solid #666;\">Non U.S. pricing based on exchange rates<br>\nin effect as of $cx->Date";
Return current item: Currency Exchange Rates with PHP & XML