Created
August 25, 2016 16:05
-
-
Save juan2three/88fceba5daee59cee43b90626cac1e4e to your computer and use it in GitHub Desktop.
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 | |
$url = 'http://api.openweathermap.org/data/2.5/weather?q=Orlando&appid=e489a1082a7bba282ae688164b05ebe1&units=metric'; | |
$ch = curl_init(); | |
curl_setopt($ch,CURLOPT_URL,$url); | |
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); | |
// curl_setopt($ch,CURLOPT_HEADER, false); | |
$output=curl_exec($ch); | |
curl_close($ch); | |
//echo "<pre>"; | |
$data = json_decode($output,true); | |
$data = $data[0]; | |
echo "Name - ".$data['main']; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment