Quote:
Originally Posted by TasteMyLipstick
What is less flexible about my code?
|
Theoretically, for example you can't control, if the $_GET['lang'] is defined, or not. You may only surmise, starting from isset($_GET['lang']) conjunct with in_array($_GET['lang'], $a_languages).
Quote:
Originally Posted by TasteMyLipstick
I'd say it's much more flexible than yours, where you used switch case operators for checking the value of every single language. I think it's not so smart to do so.
|
Well, it's not a big deal, I think. Assuming that:
First of all, the count of languages is finite, and in handsome majority of cases not greater than 2 or 3. So probably our switch structure will not grow up so much.
Secoundly, you may perform custom actions different for each language.
In addition:
Your code contains useless assignings, checks, script termination, also it outputs HTML code(which, I suppose, is very rough for back-end layer) ...