N
N
Nikolay2017-10-24 15:47:37
PHP
Nikolay, 2017-10-24 15:47:37

How to put 2 languages ​​on the site?

How can I load the language file when choosing a language
1-file - ru.php in the file <?php define('L1', 'Main'); ?>
2- file - en.php in file <?php define('L1', 'Home'); ?>

print "<a href='test.php?language=en'>EN</a> | <a 
 
href='test.php?language=rus'>RUS</a>";
 
$language=....
 
if($_GET['language']==$language)
{
include"выбранный язык";
 
print $переменная;
}

Well, on the website:
<p><?=echo L1; ?></p>  Должна меняться при выборе языка

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arman, 2019-07-26
@targetologru

try u modifier , @ui

S
shagguboy, 2017-10-24
@shagguboy

php.net/manual/en/function.gettext.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question