3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('DAY', 24*60*60, true); $startDate = date('F d, Y'); $AdExpirationDate = strtotime($startDate . '+120 days'); //Calculate the difference between expiration date and today to see if it expires within 30 days $today = date("F d, Y"); $DayDiff = abs($AdExpirationDate - strtotime($today)); $DaysToExpiration = floor($DayDiff / DAY); if ($DaysToExpiration <= 30) { $Expire30 = true; }else{ $Expire30 = false; } echo $DaysToExpiration ." - "; if($Expire30) { echo "true"; } else { echo "false"; } ?>

preferences:
52.02 ms | 402 KiB | 5 Q