翻译PHP平日和月 [英] Translating PHP weekdays and months

查看:157
本文介绍了翻译PHP平日和月的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何将PHP平日和月份翻译成本地语言的想法?

  $ timestamp = strtotime('我们有脚本打印下周5个星期的工作日,我希望他们用其他语言。下个星期一'); 
($ i = 0; $ i <35; $ i ++){
echo strftime('%A',$ timestamp)。;
$ timestamp = strtotime('+ 1 day',$ timestamp);
}

是否有很好的整合用PHP和moment.js?我查看了在moment.js中使用PHP的date()格式 GitHub fightbulc / moment.php
,但我不明白如何使用这些..



预先感谢您。

解决方案

我想你在找什么

检查和如果你请检查这个



UPDATE

  setlocale(LC_TIME,fi); 
echo utf8_encode(strftime('%A'));

结果

  perjantaina 

这个礼物给你们ISO语言代码



请参阅


Any ideas for translating PHP weekdays and months to local language? I have script which prints weekdays of next 5 weeks and I want that they are in other language.

$timestamp = strtotime('next Monday');
for ($i = 0; $i < 35; $i++) {
    echo strftime('%A', $timestamp)." ";
    $timestamp = strtotime('+1 day', $timestamp);
}

Is there any good integrations e.g. with PHP and moment.js? I have looked at Use PHP's date() formats in moment.js and GitHub fightbulc/moment.php , but I don't understand how to use those..

Thank you in advance.

解决方案

i think what you looking for is in here

please check this and if you please check this also

UPDATE

setlocale(LC_TIME, "fi");
echo utf8_encode(strftime('%A'));

RESULT

perjantaina

And this as a gift for you guys the ISO language codes

See This

这篇关于翻译PHP平日和月的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆