Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$lat = "35.001965";
$lon = "34.047329";
$key = "523df554f4e883874873853b897b6da0";
$url = "https://api.openweathermap.org/data/2.5/forecast?lat=$lat&lon=$lon&appid=$key";
$data = file_get_contents($url);
$json = json_decode($data,true);
$temp = $json["list"]["0"]["main"]["temp"];
$tempc = $temp-273.15;
$descr = $json["list"]["0"]["weather"]["0"]["description"];
$wind = $json["list"]["0"]["wind"]["speed"];
date("H:i:s");
$date = $json["list"]["0"]["dt_txt"];
echo($date);