Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php validate credit card expiration date

$expires =  date_format( DateTime::createFromFormat('ym', $cc_expiration),"ym");

$now =  date_format(new DateTime(),"ym");

if ($expires < $now) {
    return 'Expired!';
}
 
PREVIOUS NEXT
Tagged: #php #validate #credit #card #expiration #date
ADD COMMENT
Topic
Name
4+4 =