Last active
June 28, 2018 20:09
-
-
Save BAHC/98c5c582fc0b14234613d290a3f4d144 to your computer and use it in GitHub Desktop.
Get Exchange Rate For One Pair In One Direction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'exchange_rate.php'; | |
function get_exr($_from=null, $_to=null) | |
{ | |
$_res = null; | |
$_pair = $_from.'_'.$_to; | |
$_pairs = exchange_rate([ $_from => $_to ]); | |
if(is_array($_pairs) && isset($_pairs[$_pair])) | |
{ | |
$_res = $_pairs[$_pair]; | |
} | |
return $_res; | |
} | |
echo get_exr('USD', 'TRY'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment