To make your work easier, there are a few additional functions, which will be described below.
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.
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.
Пример 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); ?>