In php i want to compare two dates of format m-d-Y
so i tried following code
$strdte=trim($_REQUEST['stdate']);
$enddte=trim($_REQUEST['enddate']);
$today_time = $strdte;
$expire_time = $enddte;
if ($expire_time < $today_time)
{
print '<script type="text/javascript">';print 'window.onload = function(){';
print 'alert("You cannot have end date before startdate")';
print '};';print '</script>';
}
but problem is it sometimes work and sometime doesn't.Could anyone tell me what was the reason for this problem?
Thanks in advance.