How do I implement multiple languages for one website?

Hi,

You can use language files also.

Create english.php, hindi.php and spanish.php
And define words and phrases in that file and use them in your php scripts accordingly.
You just have to load the language file that the user has selected.

Example:

In english.php:

$language["hi"] = "hi";
$language["howareyou"] = "how are you ?";

In hindi.php:

$language["hi"] = "namaste";
$language["howareyou"] = "kaise hain aap ?";

In spanish.php:

$language["hi"] = "hola";
$language["howareyou"] = "como es usta ?";

When a user comes to your site the default lang. file in english.php

Your php file should have something like that in it:

<?php
if (empty($_SESSION["langfile"])) { $_SESSION["langfile"] = "english.php"; }
require_once ($_SESSION["langfile"]);
echo $language["hi"];
?>

So they see: hi
But if they select Hindi or Spanish then you load content from the respective language file and if its Hindi then it will show: namaste and if its spanish it will show hola

Links can be like this:

<a href="language.php?l=english">En</a>
<a href="language.php?l=hindi">Hi</a>
<a href="language.php?l=spanish">Sp</a>

language.php

if (!empty($_GET["l"]))
{
$_SESSION["langfile"] = $_GET["l"] . ".php"; 
header ("location: index.php"); exit();
}
?>

This is a very basic example, you can make it more complex and more secure.

Hope this helps.

Thanks.