PHP星期几数字到星期几文本不是英语 [英] PHP day of week numeric to day of week text not English
本文介绍了PHP星期几数字到星期几文本不是英语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在Windows上使用 setlocale()
函数转换其他语言的日期名称,但它不工作。
I tried to use setlocale()
function on windows to convert days name in other language but it didn't work.
<?php setlocale(LC_ALL, 'nl_NL');
echo date("l", strtotime($variable); ?>
任何人都有一个替代 setlocale()
?我使用Codeigniter框架。
does anybody have an alternative for setlocale()
? I use the Codeigniter framework.
推荐答案
nl_NL
是典型的Unix样式区域设置名称在Windows上,区域设置遵循不同格式。您希望nld,holland或netherlands。
nl_NL
is a typical Unix style locale name. On Windows, locales follow a different format. You want "nld", "holland", or "netherlands".
此外, date()
不是语言环境感知的,您可能需要 strftime()
。
Additionally, date()
is not locale-aware. You probably want strftime()
.
这篇关于PHP星期几数字到星期几文本不是英语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文