Getting Tide Data

  • 1
  • Question
  • Updated 8 years ago
Hi, Just came across the wunderground api and I've been playing around with it. Its quite impressive, however I seem to be stuck on getting some tide data.

I am using the code
$json_string2 = file_get_contents(
$parsed_json = json_decode($json_string);
$high_tide = $parsed_json->{'tide'}->{'tideSummaryStats'}->{'maxheight'};
echo "High Tide=".$high_tide."

This should ideally give me the high tide which at this moment in time is 6.27. I get the full information with print_r($parsed_json) and I can see right at the very end the hig tide, but I dont see to be able to access it using the method above.

If I use var_dump with $high_tide it tells me the variable is NULL.

Do you have any suggestions?

Photo of Naescent


  • 2 Posts
  • 0 Reply Likes

Posted 8 years ago

  • 1

Be the first to post a reply!