Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7922113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:50:36+00:00 2026-06-03T16:50:36+00:00

I have a simple html site.I want to change the language for that based

  • 0

I have a simple html site.I want to change the language for that based on the country code
using php.That means i want to localise my site. Or translate the site to the user selected language
Any one help me with this
Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:50:37+00:00Added an answer on June 3, 2026 at 4:50 pm

    I would recommend allowing the user to choose their own language. However, you could use something like this:

    <?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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple HTML site with 100+ pages or so. I want to
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I have a simple html form. On php page. A simple list is placed
I have a simple HTML table which is bound using knockoutJS. However, I've added
I have a site that has 2 languages: English and Swedish. What I want
I have an html site with a form in it and I want the
I have already a web site written in Html but I want to add
I have some pages on my site that are plain HTML pages, but I
I have sample site: /index.html /appcache.manifest /style.css /test.js index.html: <!DOCTYPE HTML> <html manifest=appcache.manifest> <head>
I have downloaded the sample code from this site for FTP Client http://www.lysesoft.com/products/andftp/index.html But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.