That's actually from this thread:

http://stackoverflow.com/questions/13153053/php-function-currency-conversion