Created
April 22, 2018 06:51
-
-
Save KamranSyed/2d9c0c22ff91a63255593366a5c6e9a0 to your computer and use it in GitHub Desktop.
Currency Exchange Rates Web Service Learning by Example
This file contains hidden or 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 | |
| //This is used in a video tutorial at https://youtu.be/Y777FeIDicU | |
| require_once 'restclient.php'; | |
| $url = "http://data.fixer.io/api/"; | |
| $api = new RestClient([ | |
| 'base_url' => $url, | |
| 'format' => "json" | |
| ]); | |
| $result = $api->get("latest?access_key=abc3d54131d5be95370f61ad306e16ad&symbols=USD,AUD,CAD"); | |
| echo "<pre>"; | |
| if($result->info->http_code == 200){ | |
| print_r($result->decode_response()); | |
| }else{ | |
| print_r($result); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment