I have the following switch statement:
$html = '<div class="'. $some_value . '">';
switch ($some_value) {
case "one":
return $html . 'One Biscuit</div>';
break;
case "two":
return $html . 'Two Chimps</div>';
break;
case "three":
return $html . 'Three Pies</div>';
break;
default:
return $html . 'Meh...</div>';
}
Noticed how I added the $html
variable to each case? Not good... Is it possible to add it just once to the final value of the switch statement? I'm trying to wrap the final value in the dynamic HTML.