PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $city0 = 'Macae'; $city1 = 'Tallinn'; $city2 = 'Oslo'; $city = 'Owerri'; $a=getTemp($city0); function getTemp($city){ $apiKey='523df554f4e883874873853b897b6da0'; $url="https://api.openweathermap.org/data/2.5/weather?q=$city&appid=$apiKey"; $json=file_get_contents($url); $data=json_decode($json,true); return $data['main']['temp']; } ?>
Show:  
Copy Clear