//Содержимое index.php <?php include('./header.html'); $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); echo $lang; if ($lang == 'ru') {include('./ru.php');} else {echo 'not ru';}; if ($lang == 'en') { include('./en.php');} else {echo 'not en';}; echo $langa; include('./footer.html'); ?> //содержимое ru.php <?php $langa = 'Russian'; ?> //содержимое en.php <?php $langa = 'English'; ?> Displays the contents of header.html and footer.html, and nothing between them. If I just include ('./ ru.php'), then it works, but I need to be envious of the condition. Even echo $ lang does not work, and if you remove conditional statements, it displays normally.
if(in_array($lang, ['ru', 'en'])){ include "./{$lang}.php"; }if(in_array($lang, ['ru', 'en'])){ include "./{$lang}.php"; }(or||) - teran