• Hi, I’m trying to find a way to show widgets depending on the Users Browser Language. I tried seveal things but nothing worked. Do you have any idea?
    here is an example I tried:

    if (($lang==”en_EN”) OR ($lang==”en-EN”) OR ($lang==”de_CH”) OR ($lang==”de-CH”) OR ($lang==”de_DE”) OR ($lang==”de-DE”)) {
    return true;
    }else {
    return false;
    }

    • This topic was modified 6 years, 10 months ago by pb75.
    • This topic was modified 6 years, 10 months ago by pb75.
Viewing 1 replies (of 1 total)
  • Thread Starter pb75

    (@pb75)

    I got it!! Yeah! Here’s the code:

    $http_lang = substr($_SERVER[“HTTP_ACCEPT_LANGUAGE”],0,5);
    switch ($http_lang) {
    case ‘de-CH’:
    return true;
    break;
    case ‘de-ch’:
    return true;
    break;
    default:
    return false;
    }

    • This reply was modified 6 years, 10 months ago by pb75.
Viewing 1 replies (of 1 total)

The topic ‘PHP Logic Script with check Browser Language’ is closed to new replies.