problem with array - multilingual page


Posted on 16th Feb 2014 07:03 pm by admin

this is my test page :
Code: <?php
if(isset($_GET['lang'])) {
if($_GET['lang'] == "en") {
Did you know?Explore Trending and Topic pages for more stories like this.
require_once("languages/lang-en.php");
}
elseif($_GET['lang'] == "fr") {
require_once("languages/lang-fr.php");
}
elseif($_GET['lang'] == "ar") {
require_once("languages/lang-ar.php");
}
} else {
require_once("languages/lang-fr.php");
}
?>
<html>
<head>
<title><?php echo $lang['title']; ?></title>
</head>
<body>
<div id="content">
<h1><?php $lang['title']; ?></h1>
<?php $lang['content']; ?>
<br/>
</div>
<div id="footer">
<?php $lang['footer']; ?>
</div>
</body>
</html>

and here is my included file :
Code: <?php
// english version
$lang = array();

$lang['title'] = "Welcome to My site !";
$lang['content'] = "<p>Well this is my first time setting up a multilingual website, i hope it works.</p>";
$lang['footer'] = "All rights reserved for UML (C) ".date("Y", time());
$lang['error'] = "Sorry, you cannot add words unless you're logged in !";
?>
the problem is that page displays the head title only !!!!
what should i do???
No comments posted yet

Your Answer:

Login to answer
134 Like 17 Dislike
Previous forums Next forums
Other forums

Ariba 9r - SAP MM Integration
Hi experts,

The standard Ariba adapter for 9r creates a relationship between Cost Centers

Session is not saving
I am not trying to do anything too fancy, I am just trying to get some $_SESSION data to save and us

Is this possible? If one file assigned to an ID...
I have a page that lists property listings assigned to a specific user (a manage page), with brief t

Show specific day of the week
I have been racking my brain trying to get this function to work properly and it is doing so for eve

The type or namespace name 'ServiceModel' does not exist in the namespace 'System'
When I locally run the website, it works just fine, but when I uploaded it to the hosting environmen

Replacing a string on click of a button
Hi! Is there a way to replace a string on a click of a text link?

This is what I've come up w

Word Trimming
Hi Guys & Gals!!

Hope you are all ok....

I need some help with the following

Memory Allocation
Hi folks,
see this ex:

int v=5;
v=v+10;

then what will do the compiler before th

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

How to show the difference between two data field in a database with php.
Hello php gurus,

how r u all... i'm not so well facing a typical problem please help me...<

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash