Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?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);
Copy Clear