I'm using this function:
function makeImmunities($data) {
$immunities = explode(',', $data);
foreach($immunities as $immunity) {
switch($immunity) {
case 'poison':
$ret .= '<img src="/images/gems/earth.gif"/> ';
break;
case 'earth':
$ret .= '<img src="/images/gems/earth.gif"/> ';
break;
case 'paralyze':
$ret .= '<img src="/images/gems/paralyze.gif"/> ';
break;
case 'death':
$ret .= '<img src="/images/gems/death.gif"/> ';
break;
case 'ice':
$ret .= '<img src="/images/gems/ice.gif"/> ';
break;
case 'invisible':
$ret .= '<img src="/images/gems/invisible.gif"/> ';
break;
}
}
return $ret;
}
And $ret has .=, so content should be added to itself. But it doesn't. I wan't it to work this way:
$data has an array which looks like this : 'poison', 'earth', 'death'. And this function returns only first case:
$ret .= '<img src="/images/gems/earth.gif"/> ';
I wan't it too add ALL of the content that $ret has if case is the same as the $immunity.