I want to define the font-weight for my tr element based on a PHP variable. What am I doing wrong in this code?
<?
$vartest = 1;
?>
<table>
<tr style="font-weight: <? ($vartest === 1) ? echo bold : echo normal ?>">
<td>aaaaaaa</td>
<td>bbbbbbb</td>
</tr>
</table>
if..else. You cannot issue commands after?and:, only expressions that return a value. So it has to beecho ($vartest === 1) ? 'bold' : 'normal'.