title: PHP Comparing a date to todays date
body: <p>I am trying to take a credit card expiry date in the format of <code>mm-yy</code> and see if that date has passed so I know if the credit card has expired. If it has expired, a class of <code>expired</code> is inserted on the <code>&lt;tr&gt;</code></p>
  <p>My code results in a sample date of 05/16 being checked, and the script says that the card has not expired when obviously this card is a year old.</p>
  <pre><code>&lt;?php foreach($card_historys as $card_history){ 
      $expired = &quot;&quot;;
      $date = strtotime($card_history-&gt;expire); //Returns a date in mm/yy
      $noww = strtotime(date('m/y'));
  
      echo &quot;expire: &quot;.$date.&quot; / now: &quot;.$noww.&quot;&lt;br&gt;&quot;;
  
      if($date &lt; $noww){$expired = 'expired';}
    ?&gt;
    &lt;tr class=&quot;&lt;?php echo $expired; ?&gt;&quot;&gt;
  </code></pre>
  <p>What did I do wrong?</p>