PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $key = "523df554f4e883874873853b897b6da0"; $lat = "46.675827"; $lon = "127.018433"; $url = "https://api.openweathermap.org/data/2.5/weather?lat=$lat&lon=$lon&appid=$key&units=metric"; $data = file_get_contents($url); $json = json_decode($data, true); $temp = $json["main"]["temp"]; $feel = $json["main"]["feels_like"]; $vision = $json["visibility"]; $vision2 = $vision/1000; $wind = $json["wind"]["speed"]; $date = $json["dt"]; $date = date("d.m.y H:i"); echo("temperature °C: ".$temp."\n"."feels like: ".$feel."\n"."visibility: ".$vision2." km"."\n"."wind: ".$wind."m/s"."\n"."time: ".$date);
Show:  
Copy Clear