18.5. Special functions
Prev | Chapter 18. Zend_Measure | Next

## 18.5. Special functions

To make your work easier, there are a few additional functions, which will be described below.

`Listing all known types`

`Listing all known units`

### 18.5.1. Listing all known types

The function `getAllTypes` returns an array containing all types of measurement.

This could be used to let a user choose the type of measurement (length, weight, area) he wishes to input.

### 18.5.2. Listing all known units

The function `getTypeList` returns an array containing all units of measurement for a given type.

This could be used to let a user choose the unit of measurement (meters, kilometers, millimeters,...) for his input.

Example 18.18. Listing all units for a given type

    <?php
    require_once 'Zend/Measure/Length.php';

    $unit = new Zend_Measure_Length(0,Zend_Measure_Length::STANDARD);

    $array = $unit->getTypeList();
    print_r($array);
    ?>

Prev | Up | Next
18.4. Manipulating Measurements | Home | 18.6. Types of measurements