Zrobiłem tak
$json = 'https://api.met.no/weatherapi/locationforecast/2.0/.json?lat=53.15&lon=15.42';
$data = json_decode($json);
Nic nie ma
Próbowałem też zapisać to na serwerze ale nic z tego
$url = 'https://api.met.no/weatherapi/locationforecast/2.0/.json?lat=53.15&lon=15.42';
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);$json_output=curl_exec($ch);
curl_close($ch);
Po zastosowaniu tego
$json_string = 'https://api.met.no/weatherapi/locationforecast/2.0/.json?lat=53.15&lon=15.42';
$obj = json_decode($jsondata,true);
wywala mi błąd
Warning: file_get_contents(https://api.met.no/weatherapi/locationforecast/2.0/.json?lat=53.15&lon=15.42): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/brzanek/public_html/prognoza/new2/choszczno.php on line 24
to jest ta linia
$jsondata = file_get_contents($json_string);