I am trying to take a credit card expiry date in the format of mm-yy
and see if that date has passed so I know if the credit card has expired. If it has expired, a class of expired
is inserted on the <tr>
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.
<?php foreach($card_historys as $card_history){
$expired = "";
$date = strtotime($card_history->expire); //Returns a date in mm/yy
$noww = strtotime(date('m/y'));
echo "expire: ".$date." / now: ".$noww."<br>";
if($date < $noww){$expired = 'expired';}
?>
<tr class="<?php echo $expired; ?>">
What did I do wrong?