Can you suggest me the best solution to use if I want to generate multiple expiration dates in PHP, please? I have something like this:
Name | activation_date | months
--------------------------------------
Record1 04/05/2016 3
Record2 01/01/2016 6
Record3 12/12/2015 12
For record1
, I use the following function
,
$expriration_date = date('Y-m-d', strtotime("+{$row['months']} months", strtotime($expriration_date)));
To generate the expiration date
starting from the "activation_date"
and then I save it into my SQL
Database
.
The problem is that I would like to generate multiple and periodic expiration dates
.
For example, for record1
, the expiration dates should be: 04/08/2016
, 04/11/2016
, 04/02/2016
and so on for 5 years and I would like to do the same for all the records.
In five years, Record1
should have 20 expiration dates, Record2
should have 10 expiration dates and so on..
EDIT
Interval times can be 3, 6, 12, 24, 36, 48 and 50 months and I would like to generate periodic expiration dates for 5 years.
How can I do this in PHP?
Moreover, is there a way to notify the most recent expiration dates to the user, then?
I've read about cron-job: this is the only solution?
Thank you for all your support!