在用
PHP制作多语言应用程序时,每个人都说
gettext是最好的方法.我只是想知道为什么?
原文链接:https://www.f2er.com/php/135964.html就像下面的方法一样,使用gettext效率更低?
<?PHP //Have seperate language files for each language I add,this would be english file function lang($phrase){ static $lang = array( 'NO_PHOTO' => 'No photo\'s available','NEW_MEMBER' => 'This user is new' ); return $lang[$phrase]; } //Then in application where there is text from the site and not from users I would do something like this echo lang('NO_PHOTO'); // No photo's available would show here ?>