note 38900 deleted from function.mktime by nlopess
| From: | nlopess@php.net | Date: | Sat, 10 Jan 2004 20:10:19 +0000 |
| Subject: | note 38900 deleted from function.mktime by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63290@lists.php.net to get a copy of this message | ||
Note Submitter: Ali Kashif
----
<?php
/*
this function will compair two dates that which date is bigger
return valuse
1 = if check date is bigger than from date
-1 = if from date is bigger than check date
0 = if both dates are euqal
*/
function getBiggerDate($ChkDate,$FromDate)
{
$ChkDate_parts=explode('-', $ChkDate);
$FromDate_parts=explode('-', $FromDate);
$ChkDate_stamp= mktime(0, 0, 0,$ChkDate_parts[1],$ChkDate_parts[2] ,$ChkDate_parts[0]);
$FromDate_stamp= mktime(0, 0, 0,$FromDate_parts[1],$FromDate_parts[2] ,$FromDate_parts[0]);
if($ChkDate_stamp>$FromDate_stamp)
{
return 1;
}
else if($ChkDate_stamp<$FromDate_stamp)
{
return -1;
}
else
{
return 0;
}
}
?>