Location: PHPKode > scripts > MyWeather > myweather/example.php
<?php

/* A simple example of MyWeather. AMIR JAFARI. */


/* Configs */

require 'MyWeather.Class.php';                  // include "MyWeather" class file

$MyWeather = new MyWeather;                     // create class

$TheCity = 'tehran';                            // set your city with change

$MyWeather = $MyWeather-> getWeather($TheCity); // get datas in array

/* Showing data */

echo "Weather of <b>".$MyWeather['Location']."</b>";
echo "<br>";
echo "Temperature : <b>".$MyWeather['Temp']."</b>";
echo "<br>";
echo "Humidity : <b>".$MyWeather['Humidity']."</b>";
echo "<br>";
echo "Preasure : <b>".$MyWeather['Preasure']."</b>";

/* the End */

?>
Return current item: MyWeather