3

I have a date field that submits the chosen dates and I want to find out if the end date is today.

So for example I want to compare 21-May-2012(today) to 21-May-2012(submitted) and see if they match or not.

Can someone please help?

Thanks in advance

4

2 回答 2

14
if ( strtotime($current) != strtotime($sumbit) )

Or just simplier:

$currentDate  = '21-May-2012';
$submit = '21-May-2012';

if ($submit != $currentDate)
  echo 'Different';
于 2012-05-21T22:44:50.560 回答
0
$currentDate  = '21-May-2012';
$submitDate = '21-May-2012';

if ($submitDate == $currentDate)
  echo 'Same';
else
  echo 'Different';
于 2017-12-03T14:18:10.637 回答