$now = new DateTime();
$month = clone $now;
$twoweek = clone $now;
$month->modify('+1 month');
$twoweek->modify('+2 weeks');
$dates = array(
$twoweek,
$month,
$now
);
usort($dates, function(DateTime $a, DateTime $b){
if($a == $b){
return 0;
}
return $a > $b ? 1 : -1;
});
$month = clone $now;
$twoweek = clone $now;
$month->modify('+1 month');
$twoweek->modify('+2 weeks');
$dates = array(
$twoweek,
$month,
$now
);
usort($dates, function(DateTime $a, DateTime $b){
if($a == $b){
return 0;
}
return $a > $b ? 1 : -1;
});
Comments
Post a Comment