I'm working on a list of products that are written in multiple languages. I have an array for each product that displays it's languages like this:
Array ( [0] => DA [1] => DE [2] => EN [3] => ES [4] => FI [5] => FR [6] => IT [7] => JA [8] => KO [9] => NL [10] => NO [11] => PL [12] => PT [13] => RU [14] => SV [15] => ZH )
I need to replace these individual codes with their language names (so EN => English). I have the following code, and it works fine with regular strings, but I can't get it to work with this array. Any thoughts?
$trans = array(
"EN" => "English",
"ZH" => "Chinese",
"DA" => "Danish",
"NL" => "Dutch",
"FI" => "Finnish",
"FR" => "French",
"DE" => "German",
"IT" => "Italian",
"JA" => "Japanese",
"KO" => "Korean",
"NO" => "Norwegian",
"PL" => "Polish",
"PT" => "Portuguese",
"RU" => "Russian",
"ES" => "Spanish",
"SV" => "Swedish",
);
echo strtr($langcodes, $trans);
$langcodes holds the array values.