Mega Code Archive

 
Categories / Php / Date Time
 

Checking credit card expiration

<?php $expires = mktime(0, 0, 0, $_POST['month'], 1, $_POST['year']); $nextMonth = mktime(0, 0, 0, date('n') + 1, 1); if ($expires < $nextMonth) {    print "Sorry, that credit card expires too soon."; } ?>