title: AM / PM value not displaying correctly in Select attribute
body: <p>I have a list of items, each with a date/time option.  I need for each list item to have the correct time displayed for it.</p>
  
  <p>But this doesn't seem to work.  It will return the correct 'am' or 'pm' value for $duedateA, but when I try to set the selected attribute value is gets wonky and will either show the wrong am or pm, or both.</p>
  
  <p>Am I doing something wrong?</p>
  
  <pre><code>if(!empty($resInvoice[0]["due_date"])){
  $duedateA = date("a",strtotime($resInvoice[0]['due_date']));
  }       
  if($duedateA == "am"){
  $selected_am = 'selected="selected"';
  }
  if($duedateA == "pm"){
  $selected_pm = 'selected="selected"';
  }   
  
  &lt;select name="due_time[a]"&gt;
  &lt;option value="am" '.$selected_am.'&gt;am&lt;/option&gt;
  &lt;option value="pm" '.$selected_pm.'&gt;pm&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>