PHP OpenWeather

378
November 28, 2016, at 7:39 PM

Alright so I am having some troubles understanding how to use the open weather API. I have tried using it as

<?php
    $request = file_get_contents('http://api.openweathermap.org/data/2.5/forecast/city?id=myidblablabla'); //example ID
    $jsonPHP  = json_decode($request);
    echo $jsonPHP->city;
?>

But I get an error saying

Catchable fatal error: Object of class stdClass could not be converted to string in

Now there is 1 more question that I have to ask, how do I get certains City Temperature, humidity etc? From the code I received I get only Moscow

READ ALSO
module.exports.report.logon is not a function

module.exports.report.logon is not a function

I'm trying to get the login to work on a scheduler, but getting the moduleexports

252
Field &#39;ID&#39; doesn&#39;t have a default value

Field 'ID' doesn't have a default value

I am using MySQL with Hibernate and JPA2

270