- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$test = date('l');
if($test = "Sunday"){
$end = strtotime('Sunday last week');
$start = date('Y-m-d',strtotime('Monday last week'));
}else{
$end = strtotime('Sunday this week');
$start = date('Y-m-d',strtotime('Monday last week'));
}
echo $start;