Hello all!
I'm a bit confused on how to use JSON. So far I've been doing fine but now that the format includes arrays I'm hitting a wall.
I'm using weather underground's API to to pull weather data. My file is http://api.wunderground.com/api/658c0f8b283e4b98/tide/q/VA/Norfolk.json
This may help for visualizing if you haven't seen it before
http://jsonformatter.curiousconcept.com/
So if I want tideSite I can normally do:$json_string = file_get_contents("http://api.wunderground.com/api/658c0f8b283e4b98/tide/q/VA/Norfolk.json");
$tide_parsed_json = json_decode($json_string);
$tide = $tide_parsed_json->{'tide'}->{'tideInfo'}->{'tideSite'};
but that's not working, is there a syntax like {'tideInfo[0]'} that I'm not understanding? Thanks!!