- print_r: documentation ( source)
- strftime: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
function getExpirationDate($months) {
$date=strftime('%c'); //Get the current date
$date=strtotime($date);
$date = strtotime("+$months months", $date); //Add x number of months to the date
$date = strtotime("+7 days", $date); //Add 7 days just to be sure
$expired=date('Y-m-d H:i:s',$date);
return $expired;
}
print_r(getExpirationDate(0.9));
?>