I have problems with accessing array in included file. Code works only when I directly include en.php. Mayby I cannot access to array words because en.php is "sub-included"?
index.php
<?php
include 'localization/langSwitcher.php';
echo $words['title'];
langSwitcher.php
<?php
function SetLanguage()
{
    if(isset($_COOKIE['lang']))
    {
        switch ($_COOKIE['lang']) {
            case 'en':
                include 'localization/en.php';
                break;
            default:
                include 'localization/en.php';
                setcookie('lang', 'en', time() + 365 * 24 * 3600, '/');
                break;
        }
    }
    else
        setcookie('lang', 'en', time() + 365 * 24 * 3600, '/');
}
SetLanguage();
en.php
<?php
$words = array(
    'title' => 'Welcome on Trex where you can buy or sell via Internet!', 
    '' => ''
);
 
    