You can create number of files(e.g en.php, fr.php) then you can include any of them using:
include_once("en.php");
or more generic and safe way (thanks to @Timothy for the suggestion):
$langArray = array( "en" => "en.php", "es" => "es.php", "fr" => "fr.php" );
if (isset($langArray[$_POST['lang']]));
include_once($langArray[$_POST['lang']]);
else // default language
include_once("en.php")
Since above code is loading variables according to file name(language name), same variables can refer to different(language specific) values. For example:
en.php
$welcome = "Hello";
$submit = "Submit";
$cancel = "Cancel";
es.php
$welcome = "Hola";
$submit = "Bla bla";
$cancel = "bla bla2";
And the usage:
<?php include_once("en.php"); ?>
<html>
...
<div id='greetings'> <?php echo $welcome . " " . $username; ?> </div>