And math has always been my weak point...
Maybe I'm a total newbie but don't you need an else if you're using an if?
And how can I then get the date plugged into a URL? I thought about making $lastWeek get plugged into a variable $Url but you can't quite do that... can you?
Here's what I came up with so far:
PHP Code:
$n = date('N');
if ($n == 7) {
$n = 0;
} else {
$n = date('N');
}
$Sun = mktime(0, 0, 0, date("m"), date("d")-$n, date("Y"));
echo "Last Sunday was ".date("m/d/Y", $Sun);
However, that's just showing today's date... so I guess I'm not doing the else statement right...

Originally Posted by
djr33
It's just some math.
PHP Code:
$n = date('N');
if ($n == 7) { $n = 0; }
$lastWeek = mktime(0, 0, 0, date("m"), date("d")-$n, date("Y"));
Bookmarks