Im trying to make a function, that takes an input, determines its value, and outputs a word from an already existing array that has been included in the script. The problem is the output is blank, i believe the function ignores variables already in the script, is there a way to change this so existing variables arent ignored by the function?
Here is the function:
The words need to be from an array because of multi-lingual requirements.
function get_genre($id)
{
if($id == "1"){
$genre = $lang['277'];
}
if($id == "2"){
$genre = $lang['278'];
}
if($id == "3"){
$genre = $lang['279'];
}
if($id == "4"){
$genre = $lang['280'];
}
if($id == "5"){
$genre = $lang['281'];
}
if($id == "6"){
$genre = $lang['282'];
}
if($id == "7"){
$genre = $lang['283'];
}
if($id == "8"){
$genre = $lang['284'];
}
if($id == "9"){
$genre = $lang['285'];
}
if($id == "10"){
$genre = $lang['286'];
}
if($id == "11"){
$genre = $lang['287'];
}
if($id == "12"){
$genre = $lang['288'];
}
if($id == "13"){
$genre = $lang['289'];
}
if($id == "14"){
$genre = $lang['290'];
}
if($id == "15"){
$genre = $lang['374'];
}
return $genre;
}