Hi,

I want to compare a array of dates ($array_date) made with a form, with the date form 'now', 'now + 1 day' and 'now + 2 days'. I wrote the code to compare the array with the date 'now' but I can't find how to get the date 'now + 1 day' and 'now + 2 days'.

The date is stored in the array as : 2015-03-14.

The function strtotime('now', '+1 day'); return an error.
Could you give me a clue ? Thanks

$date_comp = strtotime('now');
$date_comp= date('Y-m-d', $date_comp);

$i=0;
while ($i < count($array_date))
{
if ($date_comp==$array_date[$i])
 {$list[] =  t($array_date[$i]).' '.t($name_evA[$i]);}
$i++;
}

Comments

Jaypan’s picture

strtotime('+1 day'); // no 'now'