我想得到最近一个月的本地语言名称。我试过这个方法,但得到的是一个神秘的输出。
setlocale(LC_TIME, 'de_DE.ISO8859-1');
echo date('%B', strtotime('-1 month')); // returns %475
echo date('F', strtotime('-1 month')); // returns April (= english)
使用 strftime
用于本地化的月份名称。
echo strftime('%B', strtotime('-1 month'));