I would like to change this:
// use appropiate lang.xx.php file according to the value of the $lang switch ($_SESSION['lang']) { case 'en': $lang_file = 'lang.en.php'; break; case 'es': $lang_file = 'lang.es.php'; break; case 'zh-tw': $lang_file = 'lang.zh-tw.php'; break; case 'zh-cn': $lang_file = 'lang.zh-cn.php'; break; default: $lang_file = 'lang.en.php'; }
into something like this:
//include file for final output include_once 'languages/lang.'.$_SESSION['lang'].'php;
(I think the $lang_file variable becomes redundant if I do the included output-output-output above)
So that I can skip the entire switch part. I tried other combinations, but they don't seem to work. Any suggestions?
source share