本地化月/日名称列表
实际上我正在使用这个:
setlocale(LC_ALL, 'it_IT');
$monthNames = array();
for ($i = 1; $i <= 12; $i++)
{
$monthNames[] = strftime('%B', mktime(0, 0, 0, $i));
}
有没有更简单更好的方法来做到这一点?此外,这不适用于日期的名称。谢谢。
Actually I'm using this:
setlocale(LC_ALL, 'it_IT');
$monthNames = array();
for ($i = 1; $i <= 12; $i++)
{
$monthNames[] = strftime('%B', mktime(0, 0, 0, $i));
}
Is there a simpler and nicer way to do this? Furthermore this doesn't work well with the names of the days. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想这是一种方法。我没有看到任何用于获取本地化的一周或几个月的日期的内置函数。
This is one way to do it, I suppose. I didn't see any built-in functions for grabbing localized days of the week or months.
PHP 提供了一些方便的 日历 相关功能,例如
call_info
:Php provide few handy Calendar related functions, like
call_info
: