The Zend Framework Zend_Locale Component PRO

Using the Zend_Locale component we can represent different locales. Each locale is a combination of a language and a country. Usually we will set the default locale of our application during the execution of our bootstrap file.

Zend_Locale::setDefault('he_IL');

There are various possible ways for using the Zend_Locale. The following code sample creates new Zend_Locale objects for representing two different locales and printing out a specific date in according to each one of them.

$usLocale = new Zend_Locale('en_US');
$dateUs = new Zend_Date('12/02/2003', null, $usLocale);

$ilLocale = new Zend_Locale('he_IL');
$dateIl = new Zend_Date('12/02/2003', null, $ilLocale);

Zend_Debug::dump("in us ".$dateUs);	
Zend_Debug::dump("in il ".$dateIl);

The following video clip shows the execution of the last code sample.

Share:

banner for the css playlist in hebrew life michael courses for programmers

The First Steps in CSS

Learn CSS using our our videos (in Hebrew) on the CSS (he) playlist on youtube. Do it now. Do it for free.

Good Trainers Collaborate with Others

It is always essential to keep an open mind and learn from others. This applies to everyone, including teachers and especially software development trainers. Software

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences