What’s the best way to store language data?
Keep it as variables in some kind of lang.php file…
$l_ipsum = ‘smth’;
$l_rand = ‘string’;
Or select them from a database? I’m in search of your advice.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Keep them in an array, so you don’t pollute the global namespace.
Plus, you can create a helper function to get the string
Of course, there are a thousand ways to do this (and I personally wouldn’t use global variables, but it’s all up to your skill level and personal preferences)…