Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $languages = array(
- 'en' => array(
- 'title' => 'J2TEAM Community',
- 'welcome_message' => 'Hello World!',
- 'intro_message' => 'Here is an example of a multi-language website.'
- ),
- 'vi' => array(
- 'title' => 'J2TEAM Community',
- 'welcome_message' => 'Chào thế giới!',
- 'intro_message' => 'Đây là một ví dụ về trang web sử dụng đa ngôn ngữ.'
- )
- );
- $user_language = isset($_GET['hl']) ? $_GET['hl'] : 'en'; // default: English
- $i18n = $languages[$user_language];
- ?><!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <title><?php echo $i18n['title']; ?></title>
- </head>
- <body>
- <h1><?php echo $i18n['welcome_message']; ?></h1>
- <p><?php echo $i18n['intro_message']; ?></p>
- </body>
- </html>
Add Comment
Please, Sign In to add comment