Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By sebastien33 on
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
<?phpstrtotime('+1 day'); //