Hello
I am trying to do the following:
define a global array called translation in a file called english.php:
[code=php]
<?php
$translation = Array();
$translation [‘hi’] = “hi”;
$translation [‘bye’] = “bye”;
?>
a second file called LanguageManager.php has the following definition:
[code=php]
<?php
$languageData = Array();
$languageData[‘English’] = Array();
$languageData[‘English’][‘file’] = “english.php”;
?>
This is the file that uses the code:
[code=php]
<?php
include_once(LanguageManager.php);
global $languageData;
include($languageData[$language][‘file’]);
gloabl $translation ;
print $translation [‘hi’];
?>
I use the last segment of code whenever I want to display text to the screen.
The problem that sometimes I get a warning saying that ‘English’ was never defined as an index to $languageData.
What could cause this?
thanks