- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$lastmonday = strtotime('last monday of this month');
echo date('Y-m-d',$lastmonday);
$firstday = strtotime('first day of this month');
echo date('Y-m-d',$firstday);
$d1 = new DateTime($lastmonday);
$d2 = new DateTime($firstday);
$period_serv = $d1->diff($d2);
$theperiod = $period_serv->format('%a');
echo $theperiod;