Help with some dates

Posted on 16th Feb 2014 by admin

I have a list of dates in an array:

$mondays = array(
strtotime("October 12, 2009"),
strtotime("October 19, 2009"),
strtotime("October 26, 2009"),
strtotime("November 2, 2009"),
strtotime("November 9, 2009"),
strtotime("November 16, 2009")
);


It is an array of the next few mondays. I am wondering how I could figure out what the next monday in the array is depending on the current time, using time();

I cannot use strtotime("next monday") or strtotime("+1 monday") because the server I am working on is using a very old version of PHP (4.3.10-22) and it has a bug when I use strtotime("next monday");...I am also not able to upgrade the version of PHP.

Other forums