Help Please

  • 1
  • Question
  • Updated 6 years ago
Anyone see an issue with the code below. When I use this code to get temperature data it works fine. But when I switch to tide data I get nothing.

$json_url = 'http://api.wunderground.com/api/b2b4a...';

// jSON String for request
$json_string = '[http://api.wunderground.com/api/b2b4a...]';

// Initializing curl
$ch = curl_init( $json_url );

// Configuring curl options
$options = array(
CURLOPT_RETURNTRANSFER => true,

);

// Setting curl options
curl_setopt_array( $ch, $options );

// Getting results
$result = curl_exec($ch); // Getting jSON result string

$parsed_json = json_decode($result); $location = $parsed_json->{'tide'}->{'tideInfo'}->{'tideSite'}; echo "Current location is ${location}\n";
Photo of mtuman1843

mtuman1843

  • 8 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 1

Be the first to post a reply!