Esempio n. 1
0
<?php

// a basic example us using the OpenWeahtherMap library
// require the Composer autoloader
require_once '../vendor/autoload.php';
// create a default instance of OpenWeatherMap
$openWeatherMap = new OpenWeatherMap\OpenWeatherMap();
// get the daily weather for Berlin,DE
$weatherData = $openWeatherMap->getDaily(array('query' => 'Berlin,DE'));
echo '<pre>';
print_r($weatherData);
echo '</pre>';
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Basic 02</title>
    </head>
    <body>

        <table>
            <?php 
foreach ($weatherData->getForecast()->getTimes() as $time) {
    ?>
            <tbody>
                <tr>
                    <td colspan="2"><?php 
    echo $time->getDay();
    ?>
</td>
                </tr>