|
|
|
| Title : |
Google Currency Converter - Convert variable amounts between currencies with a little help from our friend Google.
|
| Categories : |
PHP, Ecommerce |
 Alix Axel |
| Date : |
Apr 28th 2009 |
| Grade : |
3 of 5 (graded 3 times) |
| Viewed : |
4920 |
| File : |
No file for this code example. |
| Images : |
No Images for this code example. |
|
| Search : |
More code by Alix Axel |
|
| Action : |
Grade This Code Example
|
|
| Tools : |
My Examples List |
|
|
|
|
|
|
|
|
|
|
Like this code?
Show the author your appreciation.
|
| |
| <?php
function Google_Currency($amount, $from, $to)
{
$matches = array();
if (preg_match('~<b>.+? = (.+?)</b></h2>~', file_get_contents('http://www.google.com/search?q=' . urlencode(floatval($amount) . ' ' . strtoupper($from) . ' to ' . strtoupper($to))), $matches) > 0)
{
if (array_key_exists(1, $matches) === true)
{
return floatval($matches[1]);
}
}
return false;
}
?> | |
Usage:
| <?php
Google_Currency(1, 'USD', 'EUR'); // 0.768816791
Google_Currency(1, 'USD', 'GBP'); // 0.686671702
Google_Currency(1, 'EUR', 'USD'); // 1.3007
Google_Currency(1, 'EUR', 'GBP'); // 0.893153883
Google_Currency(1, 'GBP', 'USD'); // 1.4563
Google_Currency(1, 'GBP', 'EUR'); // 1.11962789
?> | | |
|
| Validation function for LUHNMod10 and variant. Can discriminate credit card numbers of varying lengths. Uses [Double >> Sum-of-Digits] transform. Categories : Credit Cards, Authentication, Ecommerce, PHP | | | an example of the cyberlib payment class Categories : PHP, PHP Classes, Ecommerce, Credit Cards | | | PCAC (pretty cool auction client), auction client server applications Categories : PHP, MySQL, Ecommerce | | | PHPCatalog Categories : Ecommerce, PHP, Complete Programs | | | How to validate an Israeli ID number. Categories : Ecommerce, PHP, Algorithms | | | After discovering some credit card validation routines didnt work - here is one that I found works with all the numbers I have tried so far Categories : Credit Cards, Ecommerce, PHP | | | Shopping Basket On-Line Ordering System. Categories : Complete Programs, MySQL, PHP, Ecommerce, Databases | | | open source online php shop project ecommerce commerce Categories : PHP, Ecommerce | | | Authorize.net AIM Interface Class v1.0.0 Categories : PHP, PHP Classes, Ecommerce, Payment Gateways | | | Credit Card Identification and Validation Class - The credit_card class provides methods for cleaning, validating and identifying the type of credit card numbers. Categories : PHP, PHP Classes, Credit Cards, Ecommerce, Algorithms | | | shopping cart class with add/edit/delete product functionality. Categories : PHP, PHP Classes, Ecommerce | | | Example Shopping cart class Categories : Ecommerce, PHP, PHP Classes | | | phpAds, a complete banner and ad management system with detailled tracking and stats. Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases | | | This is a redirection program which is as good as the come.to v3 url
redirection, complete with admin interface all clients stored in mysql
Categories : PHP, MySQL, Ecommerce, HTML and PHP, Complete Programs | | | Get TemplateMonster data Categories : Arrays, Ecommerce, PHP, Strings | |
| |
| |
|