0

我在我的网站中使用了一个非常好的多语言脚本。

http://www.bitrepository.com/php-how-to-add-multi-language-support-to-a-website.html

但不幸的是我有一个问题:

我需要处理语言页面 ( languages/lang.en.php) 中的信息,以便从我的后台进行编辑,而不是转到语言页面并从那里填写。

例如,可以从文件柜languages/lang.en.php中产生回声吗?

我试过但没有成功,我喜欢将语言页面传达给我的数据库。

我试图看看我是否可以在语言文件中回显这部分代码:

$lang['PAGE_TITLE'] = '我的网站页面标题';

改成

$lang['PAGE_TITLE'] = ''; 但不起作用,看起来它只适用于 html 标签。

4

1 回答 1

0

如果在您的 php 页面中,您将标题设置为:

<title><?php echo $lang['PAGE_TITLE']; ?></title>
//change this to
<title><?php echo $lang-pagetitle; ?></title>
//and at the top of the document
$lang-pagetitle = $lang['PAGE_TITLE'];
//and when it needs to be changed, put this above where the title is echoed, 
//after where $lang-pagetitle is initially defined:

if(whatever condition) {
$lang-pagetitle = "something else";
}
于 2012-04-13T16:58:28.010 回答