So I have this line:
echo '<option value="random" ' .
($lol_settings->gallery_effect == "random") ? 'selected=selected' :
false.'>Random</option>';
But on the output I get something like this:
<select>
selected=selected
<option value="foo">foo</option>
</select>
Why do I get this? Where is my typo/bug? Maybe you guys can see it?
Thank you.
You need to enclose your ternary expression (the entire thing) in parenthenses
Or separate the expressions with a comma (wich is an option with
echo):Codepad of the differences
What is currently happening with your statement is the equivalent of this: