This mini tutorial shows you the basic of how to create a multi language website with php.
View Code PHP
<?php include('lang.php'); $default = ($_GET['lang']=='') ? 'en' : $_GET['lang']; echo $lang[$default]['hello'].','.$lang[$default]['my_name'].' John Doe'; ?> |
View Code PHP
<?php $lang = array( 'en'=-->array( 'hello'=>'Hello', 'my_name'=>'My name is' ), 'fr'=>array( 'hello'=>'Bonjour', 'my_name'=>'J\'appelle' ), 'es'=>array( 'hello'=>'Holla', 'my_name'=>'Me llaman' ) ); ?> |