Constants

FORECAST_3DAY

FORECAST_3DAY

Forecast length constants *

FORECAST_5DAY

FORECAST_5DAY

FORECAST_7DAY

FORECAST_7DAY

FORECAST_10DAY

FORECAST_10DAY

FORECAST_TYPE_STANDARD

FORECAST_TYPE_STANDARD

Standard forecast summary *

FORECAST_TYPE_DETAILED

FORECAST_TYPE_DETAILED

Detailed forecast, contains a day/night component for each day *

FORECAST_TYPE_HOURLY

FORECAST_TYPE_HOURLY

Hourly forecast *

FORECAST_FIELD_WIND

FORECAST_FIELD_WIND

FORECAST_FIELD_PRECIPITATION

FORECAST_FIELD_PRECIPITATION

FORECAST_FIELD_HUMIDITY

FORECAST_FIELD_HUMIDITY

FORECAST_FIELD_ACCUMULATION

FORECAST_FIELD_ACCUMULATION

UNITS_STANDARD

UNITS_STANDARD

Unit constants *

UNITS_METRIC

UNITS_METRIC

CONVERSION_MPH_TO_KNOTS

CONVERSION_MPH_TO_KNOTS

Conversion constants *

CONVERSION_KPH_TO_KNOTS

CONVERSION_KPH_TO_KNOTS

CONVERSION_MPH_TO_KPH

CONVERSION_MPH_TO_KPH

CONVERSION_KPH_TO_MPH

CONVERSION_KPH_TO_MPH

CONVERSION_MB_TO_INCHES

CONVERSION_MB_TO_INCHES

CONVERSION_KM_TO_SM

CONVERSION_KM_TO_SM

SEARCHTYPE_STANDARD

SEARCHTYPE_STANDARD

Location search types *

SEARCHTYPE_IP

SEARCHTYPE_IP

SEARCHTYPE_ZIP

SEARCHTYPE_ZIP

SEARCHTYPE_CITYSTATE

SEARCHTYPE_CITYSTATE

Methods

degToDirection()

degToDirection(integer  $degree) : string

Utility function to return textual cardinal compass directions from degress.

Parameters

integer $degree

The degree direction (0 - 360).

Returns

string —

The cardinal direction.

calculateWindChill()

calculateWindChill(double  $temperature, double  $speed) : double

Calculate windchill from temperature and windspeed.

Temperature has to be entered in deg F, speed in mph!

Parameters

double $temperature

The temperature in degrees F.

double $speed

The wind speed in MPH.

Returns

double —

The windchill factor.

calculateHumidity()

calculateHumidity(double  $temperature, double  $dewPoint) : double

Calculate humidity from temperature and dewpoint This is only an approximation, there is no exact formula, this one here is called Magnus-Formula

Temperature and dewpoint have to be entered in deg C!

Parameters

double $temperature

Temperature in degrees C.

double $dewPoint

Dewpoint in degrees C.

Returns

double

calculateDewPoint()

calculateDewPoint(double  $temperature, double  $humidity) : double

Calculate dewpoint from temperature and humidity This is only an approximation, there is no exact formula, this one here is called Magnus-Formula

Temperature has to be entered in deg C!

Parameters

double $temperature

Temperature in degrees C.

double $humidity

Humidity.

Returns

double

convertPressure()

convertPressure(double  $pressure, string  $from, string  $to) : float

Convert pressure between in, hpa, mb, mm and atm

Parameters

double $pressure

The pressure in $from units.

string $from

Units converting from.

string $to

Units converting to.

Returns

float —

The converted pressure

convertSpeed()

convertSpeed(double  $speed, string  $from, string  $to) : double|integer|boolean

Convert speed between mph, kph, kt, mps, fps and bft

Function will return 'false' when trying to convert from Beaufort, as it is a scale and not a true measurement

Parameters

double $speed

The speed in $from units.

string $from

The units to convert from.

string $to

The units to convert to.

Returns

double|integer|boolean

convertDistance()

convertDistance(double  $distance, string  $from, string  $to) : double

Convert distance between m, km, ft and sm

Parameters

double $distance

The distance in $from units.

string $from

The units to convert from.

string $to

The units to convert to.

Returns

double

convertTemperature()

convertTemperature(double  $temperature, string  $from, string  $to) : double

Convert temperature between f and c

Parameters

double $temperature

The temperature in $from units.

string $from

Units to convert from.

string $to

Units to convert to.

Returns

double