Shoebox
Shoebox

Reputation: 601

Show content between two dates with PHP?

I want to be able to show some content or echo some text between and on two dates.

Its for a promotion of a product, between the dates given the price will be lower and after the promotion the price will return to the original cost.

Is this possible?

Cheers

Matt

Upvotes: 1

Views: 817

Answers (1)

Nick Q.
Nick Q.

Reputation: 3986

$current_time = time();
if($current_time > $start_time && $current_time < $end_time){
    // Whatever you want during the time interval
}else{
    // Whatever you want outside the time interval
}

Upvotes: 1

Related Questions