- var_dump: documentation ( source)
- time: documentation ( source)
- str_replace: documentation ( source)
- strtotime: documentation ( source)
- define: documentation ( source)
<?php
define( 'MINUTE_IN_SECONDS', 60 );
define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS );
define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS );
define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS );
define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS );
function test( $date ) {
$reminder_time = strtotime( str_replace( '-', ' ', $date ) . ', 2015' );
$reminder_time = $reminder_time - ( DAY_IN_SECONDS );
var_dump( ( time() >= $reminder_time ) );
}
test( 'nov-21' );
test( 'dec-23' );
test( 'dec-24' );
test( 'dec-25' );