提交数月后,将值保留在选择标记(for循环)中

I am trying to keep values in select tag (for loop) after submitting if the are errors in the form for months my code is

<div class="form-group col-lg-2">
  <label style="color:transparent;" id="test_color">h</label>
  <select name="month" id="month" class="form-control">
    <option value="">Month</option>
    <?php for($m=1; $m<=12; ++$m): ?>
      <option value="<?=date('F', mktime(0, 0, 0, $m, 1));?>"<?php if (isset($month) && $month==$m) echo "selected";?>>
      <?=date('F', mktime(0, 0, 0, $m, 1));?></option>
    <?php endfor; ?>
    </select>
</div>

But it doesn't work ...