I believe this will work for you, might need to buff it up but is should function. It is a part of a script I use in a customer contact page. Once submitted, the customer service department has 4 working days to reply. Using the full script, PHP determines if the request was submitted on a weekend (and increases the minimum date of reply if it is), and then determines if the maximum date of reply falls on a weekend and increases as required.
One thing you need to do is check to see what week day number your server is returning. I know it is supposed to be the same all over, but never hurts to be sure. Copy the second script into a blank page and run it, the number it returns is the week day number your server is returning for the current day. If it is Wednesday and it returns 3, then the script below works fine. If it is Wednesday and the server returns 5, then you have to adjust the if statement checking the day accordingly.
Let me know if it works for you. BTW, unfortunately, you will only be able to check the functionality of the script on Saturday or Sunday, this is returning dates off the server, not the client. At least thats whats happening with me. I can change the date on my computer all I want, but it still returns today's date from the server.
Jim
Script 1: Checking today and adjusting for weekends.
$jetzt = time();
//begin process to check if the end date falls on a weekend
$theDate = getdate($jetzt);
$day1 = $max[wday];
//if the date falls on a weekend, assign variable to increase
//this is the if statement you need to change
//if the server returns another date for today
//as discussed above.
if ($day1 > 5) {
if($day1 == 6) {
$increase = 2;
} else {
$increase = 1;
}
}
//if required, increase the end date
if ($increase) {
$newDate = time() + ($increase * 86400);
} else {
$newDate = time();
}
$max = getdate($newDate);
$dateToday = $max["weekday"] . ", " . $max["month"] . " " . $max["mday"] . ", " . $max["year"];
echo $dateToday;
Script 2: Checking your server.
<?php
$jetzt = time();
$min = getdate($jetzt);
//determine what day of the week it is
$day = $min["wday"];
echo $day
?>