2017-07-13 69 views

回答

1

如果您的服務器具有LC語言圖書館,你可以簡單地使用PHP函數沒有任何poEdit的互動,您可以在這裏找到細節strftime 簡單的例子:

setlocale(LC_TIME, "fi_FI"); 
echo strftime(" in Finnish is %A,"); //%A means A full textual representation of the day Sunday through Saturday 
setlocale(LC_TIME, "fr_FR"); 
echo strftime(" in French %A and"); 
setlocale(LC_TIME, "de_DE"); 
echo strftime(" in German %A.\n"); 
+0

我有一些麻煩的編碼,但它似乎是我所需要的。我正在研究一些方法,例如'setlocale(LC_ALL,'fr_FR.UTF-8');'但是當我把.UTF-8沒有任何反應時,只是用英文顯示。這與我測試的每種語言都是一樣的。 – user3628807

+0

好的,我解決了編碼問題。感謝您讓我知道這個功能! :) – user3628807

+0

請記住,在你的服務器應該有fr_FR語言庫,例如我的服務器是CENTOS,並讓我們檢查安裝的法語庫'localectl list-locales | grep FR' –

0

您可以使用PHP的日期()來做到這一點。這裏manual/en/function.date.php

檢查做這樣

$day_of_week_in_words=date('N');//o/p as 4 means Thursday 
$day_of_week_in_words=date('n');//o/p as 7 means July 
相關問題