Thank you for your input! I actually "borrowed" the code from the community project Weekly Stats:
PHP Code:
// Variables
$current_date = time();
// Get day of the week
$current_day = dayofweek();
// Find last Monday
$last_monday = mktime(0,0,0, date("m", $current_date), date("d", $current_date)-($current_day-1), date("Y", $current_date));
And the day function:
PHP Code:
/**********************************************************
* Function retuns the day of the week as an integer.
* Used to find the last Monday
**********************************************************/
function dayofweek()
{
$days = array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
return array_search(date("D"), $days) + 1;
}
Thanks!