Returning API values from Google
-
Hi,
I need to return json values from the google currency api. I have tried using the
wp_remote_get()
method but nothing is returned. Not really sure what I’m doing with it. The code snippet I’m using is from https://currency-api.appspot.com/ , the php code is$url = "https://currency-api.appspot.com/api/USD/EUR.json?amount=1.00"; $result = file_get_contents($url); $result = json_decode($result); if ($result->success) { echo "1 USD is worth $result->rate EUR"; }
I would like to use this within a theme template page
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Returning API values from Google’ is closed to new replies.