gettext
(PHP 3>= 3.0.7, PHP 4 , PHP 5)
gettext -- 在目前的域中找尋信息
Description
string
gettext ( string message)
函數如能找尋到一個譯項則會傳回該譯文段,否則就傳回提交給它的信息參數。 你可以用底線號當作是本函數的別名。
示範 1.gettext()-check <?php
// Set language to German
putenv ("LANG=de");
// Specify location of translation tables
bindtextdomain ("myPHPApp", "./locale");
// Choose domain
textdomain ("myPHPApp");
// Print a test message
print (gettext ("Welcome to My PHP Application"));
?> |
|