+ Reply to Thread
Results 1 to 2 of 2

Thread: Any ideas how change language works ?

  1. #1

    Any ideas how change language works ?

    I got a website and i`d like the user to choose his language , any ideas how can that be done ?

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    15
    You can use something like that :
    Code:
    <?php
    if (!isset($language)) {      
        $language = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);      
        $language = strtolower(substr(chop($language[0]),0,2));      
    }      
    ?>
    $language would then contain the language you should display to your user. What you do from there is up to you.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts