webapp jquerymobile php, 1 php lang, .
:
if the user configured his language as English, I included English .php in my header, if the user uses Spanish i, include spanish.php:
english.php:
<?php
$sentence="this is a sentence";
?>
spanish.php
<?php
$sentence="esto es una frase";
?>
if you are "echo $ sentence", it will take the one from the file that you included. I store the selected language in a cookie and include the corresponding language file.
source
share