| [ Index ] | osCommerce
Docs :: PHP Cross Reference For osCommerce 2.2 MS2 Provided By OSCdox.com |
1 <?php 2 /* 3 $Id: localization.php,v 1.12 2003/06/25 20:36:48 hpdl Exp $ 4 5 osCommerce, Open Source E-Commerce Solutions 6 http://www.oscommerce.com 7 8 Copyright (c) 2003 osCommerce 9 10 Released under the GNU General Public License 11 */ 12 13 function quote_oanda_currency($code, $base = DEFAULT_CURRENCY) { 14 $page = file('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $code . '&format=CSV&dest=Get+Table&sel_list=' . $base); 15 16 $match = array(); 17 18 preg_match('/(.+),(\w{3}),([0-9.]+),([0-9.]+)/i', implode('', $page), $match); 19 20 if (sizeof($match) > 0) { 21 return $match[3]; 22 } else { 23 return false; 24 } 25 } 26 27 function quote_xe_currency($to, $from = DEFAULT_CURRENCY) { 28 $page = file('http://www.xe.net/ucc/convert.cgi?Amount=1&From=' . $from . '&To=' . $to); 29 30 $match = array(); 31 32 preg_match('/[0-9.]+\s*' . $from . '\s*=\s*([0-9.]+)\s*' . $to . '/', implode('', $page), $match); 33 34 if (sizeof($match) > 0) { 35 return $match[1]; 36 } else { 37 return false; 38 } 39 } 40 ?>
title
Description
Body
title
Description
Body
| Generated: Tue Nov 4 23:53:39 2003 | Hosted By :: AABox.com |
Cross-referenced by PHPXref 0.4 |