+7 days to date supplied from form

Hi,

I have a form where the user selects a date that the event is on, i want to add a feature that allows then to say “add every Monday for the next month”.

So the date is a varibale set from the form
$date = $_REQUEST[date];

for example if this was 08/01/2012 how would i get the next 3 Mondays dates?

I was thinking adding 7 to the first $date and then adding 7 to the new $date and so on…

any other suggestions welcome.

Thanks Ian

Have you tried anything? You could possibly loop to the next Monday (first checking that the selected date is not a Monday) then use strtotime(’+7 days’) from that date.

Sponsor our Newsletter | Privacy Policy | Terms of Service