xxxxxxxxxx
$monday = strtotime('last monday', strtotime('tomorrow'));
$sunday = strtotime('+6 days', $monday);
echo "<P>". date('d-M-Y', $monday) . " to " . date('d-M-Y', $sunday) . "</P>";
xxxxxxxxxx
$firstday = date('l - d/m/Y', strtotime("this week"));
echo "First day of this week: ", $firstday;
xxxxxxxxxx
date('w'); //gets day of week as number(0=sunday,1=monday...,6=sat)
//note:returns 0 through 6 but as string so to check if monday do this:
if(date('w') == 1){
echo "its monday baby";
}
xxxxxxxxxx
echo date('d', strtotime('2022-02-02')); // 02
echo date('j', strtotime('2022-02-02')); // 2