Reply to Re: Translating output of PHP functions

Your name:

Reply:


Posted by Janwillem Borleffs on 08/28/05 18:41

Jochem wrote:
> The standard output of a PHP function (like date, time etc) is
> English. However, I need to translate them to Danish. Does anybody
> know a easy way to do this? Is there a functionality to do
> translations like this I am not aware of?
>
> The main issue is to translate things like "Tuesday, 11 October 2005"
> into Danish (or any other language for that matter).
>

You can use the setlocale() function:

/* Set locale to Danish */
setlocale(LC_ALL, 'da_DK.ISO_8859-1');

/* Output: fredag 22 december 1978 */
echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));

This is based on the info found at http://www.php.net/setlocale; also notice
the user contribution from misc dot anders at feder dot dk
on that page.


JW

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация