I want to find out how I can store small strings in an array and output them correct.
In this case I want to set a two-letter language code in an array at the top and
then output a string in that language later.
I really appreciate your help.
The following code I’ve made does not work but it’s something like this I’m looking for:
<?php
// Set the language
$settings = array(
Language => "en"
);
// Set the strings
$locales = array(
Installed => array("en", "da"),
TheString => array("Dog", "Hund")
);
// Do some magic
$lang = $settings["Language"][0];
// Output Dog (or Hund if the language is "da")
echo $lang["TheString"];
?>
This will either output
dogif$settings['language']isen, orhundif it isda.