index.php 397 B

123456789101112131415
  1. <?php
  2. require __DIR__ . '/vendor/autoload.php';
  3. $url = 'https://www.yr.no/place/Norway/Troms/Tromsø/Tromsø/forecast_hour_by_hour.xml';
  4. $forecast = new App\Yr\Forecast($url);
  5. echo '<pre>';
  6. var_dump($forecast->getLocation());
  7. foreach ($forecast->getTabular()->getBetween(
  8. $forecast->getSunset(), $forecast->getSunrise()->add(new \DateInterval('P1D'))
  9. ) as $time)
  10. echo $time . "\n";
  11. ?>