Reputation: 485
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
Upvotes: 4
Views: 20636
Reputation: 1
$currentDate = '21-May-2012';
$submitDate = '21-May-2012';
if ($submitDate == $currentDate)
echo 'Same';
else
echo 'Different';
Upvotes: 0
Reputation: 48091
if ( strtotime($current) != strtotime($sumbit) )
Or just simplier:
$currentDate = '21-May-2012';
$submit = '21-May-2012';
if ($submit != $currentDate)
echo 'Different';
Upvotes: 16