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()
.