我有一个目前是英文的网站;当用户单击不同的语言时,我希望能够切换到不同的语言(网站上几乎没有国家标志图标)。我目前正在尝试的方式是使用数组,例如:
$english = array('index',
array('h1' => 'this is some h1 text',
'h2' => 'this is some h2 text'));
$japanese = array('index',
array('h1' => '世界交換への歓迎',
'h2' => 世界交換への'));
print $english[index][h1];
print $japanese[index][h2];
如您所见,如果我用单独的语言对每一页都这样做,那将是大量的代码。我还可以尝试什么其他方法?