PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Currency creation based on a country

Zend_Currency is also able to work on a given country by using Zend_Locale internally.

<?php
$currency 
= new Zend_Currency('US');

// See the actual settings which are fixed to 'en_US'
// var_dump($currency);

Uppercase territories

When you know that you are using a territory, then you should uppercase it. Otherwise you could get an in your eyes false locale in return. For example, when you give "om" then you could expect "ar_OM" to be returned. But in fact it returns "om", as it's also a language.

Therefor always uppercase the input when you know that a territory is meant.

Zend Framework