hi there, i think i am really tired and novice for this one…
i need some quick help and i am sure this is quick for an experienced user.
i have a script that changes the language of the page and i locate the language of the page by storing the session to a “language.tmp” file
so after i do this i have this script… to output the “english text” or “Русский текст”.
<?php
$languages['Eng']="english text";
$languages['Rus']="Русский текст";
$l=file_get_contents("lang.tmp");
while (list($key, $value) = each($languages))
{
if($l==$key);
echo ''.$value.'';
}
?>
So the problem here is that when i run this it returns me both the values of the array “languages”, what i need is, the script outputting just the one in use, which is collected using “$l=file_get_contents(“lang.tmp”);” from the tmp file. The tmp file has only one value and that is “Eng” or “Rus” at a time, depending on user choise.
I understand that the problem is in the while loop but how can i get rid of it and output just the current value in use… “english text” or “Русский текст”.