[thelist] New to PHP - Code for calculations

Boris Mann boris at bmannconsulting.com
Mon Aug 11 16:38:57 CDT 2003


On Monday, August 11, 2003, at 05:26 PM, Ken Wan wrote:

> Please help a PHP newbie. I don't have time to learn PHP but need to  
> create
> a currency converter. I'd like to keep the calculation separate from  
> the
> conversion rate, so that someone who is not web-savvy at all can go  
> and edit
> the conversion value (variable in a file called conversion.php for  
> example)
> and have it updated globally on a website. Only one conversion is  
> required
> (i.e. from Canadian dollars to American).
> What would I need to do?

Here's the pseudo-code:

1. include the file which has the conversion
2. take the calculation and apply the conversion rate
3. print it to the page

Try looking for some PHP scripts to get you started. Here's one I found  
on HotScripts (http://www.hotscripts.com):

Googling "php currency exchange"  
8) came up with a couple more:

This might also prove useful:


Boris Mann

More information about the thelist mailing list