Hi,
Interesting question:
A user fills a form about how often an event happen.
He has 4 fields: [Day of the week, Day of the month, Month, Year].
In any of them, he can enter "*" as a joker, to say it doesn't matter.
For example, his birthday is every October 5th, so he enters:
[*,5,10,*], because the day of the week, or the year don't matter.
He has an apointment every Monday:
[Monday,*,*,*]
He has to pay the rent first day of each month in 2005:
[*,1,*,2005]
You get the situation?
Now once I've collected the data, I want to know WHEN is the next time
this event will happen.
How do I do that?
I've tried to play around with strtotime(), but it doesn't work for
everything.
Please help me to find a way to solve this problem.
Thank You,
Nathan
Interesting question:
A user fills a form about how often an event happen.
He has 4 fields: [Day of the week, Day of the month, Month, Year].
In any of them, he can enter "*" as a joker, to say it doesn't matter.
For example, his birthday is every October 5th, so he enters:
[*,5,10,*], because the day of the week, or the year don't matter.
He has an apointment every Monday:
[Monday,*,*,*]
He has to pay the rent first day of each month in 2005:
[*,1,*,2005]
You get the situation?
Now once I've collected the data, I want to know WHEN is the next time
this event will happen.
How do I do that?
I've tried to play around with strtotime(), but it doesn't work for
everything.
Please help me to find a way to solve this problem.
Thank You,
Nathan
Comment