Tiny Q about print out "select" menu values in one line

Permalink
I have this select menu (handlle = "select")
A
B
C

If i do this:
$select = $c->getAttribute('select');
echo $select;

HTML Print out: A <br> B <br> C <br>

I try to fix this by this php function (wont work still "<br>)
$tags = str_replace("\n", " ", $c->getAttribute('select'));


How to fix this? (I want: a b c) to use inside <div class="<?= $select ?>"...rest of the code

siton
 
hutman replied on at Permalink Reply
hutman
You can do something like this

$select = $c->getAttribute('select');
if(count($select) > 0){
    foreach($select as $option){
        echo '<div class="'.$option->value.'">'.$option->value.'</div';
    }
}