Selec Selected

I’m having trouble in showing the value of my selected value in select dropdown.


$stat = $data['ba_Status'];	


<select>
    <option value="January"<?php if (($stat == '0') || ($stat == 'R') || ($stat == 'D') || ($stat == 'S1') || ($stat == 'F1')) echo ' selected="selected"'; ?>>YES</option>
    <option value="December"<?php if ($stat == 'L') echo ' selected="selected"'; ?>>NO</option>
</select>

I tried else statement, but it an error occured.

Check the output of var_dump($stat) and check for that exact output, especially that ==‘0’, does it output what you think?

nb wouldn’t it be easier just to check if $stat is L?