Hi Steve. nilesh has the basics of it down, but I figured I'd go into a little bit more detail for you. Don't know if you need it, but a lot of people do 😉
First thing you'll need to do is create a timestamp from your date. To do this, you can use either mktime or strtotime. mktime is probably faster (no guarantees) so I'd suggest using that. You'll need to split up your date, to use it in the mktime function. Use explode for this. So this is how we go about it:
$aDate = explode("/", $date);
$sTimestamp = mktime(0, 0, 0, $aDate[1], $aDate[0], $aDate[2]);
This gives you a timestamp for your date. Now, you need todays timestamp, and you need another variable which contains the timestamp a week from now. Use the time function for this.
$sDateToday = time();
$sDateWeek = $sDateToday + 604800;
Then just use these variables as conditions in your if statement:
$aDate = explode("/", $date);
$sTimestamp = mktime(0, 0, 0, $aDate[1], $aDate[0], $aDate[2]);
$sDateToday = time();
$sDateWeek = $sDateToday + 604800;
if($sTimestamp >= $sDateToday && $sTimeStamp <= $sDateWeek) {
// if it's in the week, do this stuff
} else {
// otherwise do something else
}