PHP Reference Functions
To get the Last Day of the month in PHP
function lastday($month = ”, $year = ”) {
if (empty($month)) {
$month = date(‘m’);
}
if (empty($year)) {
$year = date(‘Y’);
}
$result = strtotime(“{$year}-{$month}-01″);
$result = strtotime(‘-1 second’, strtotime(‘+1 month’, $result));
return date(‘d/m/Y’, $result);
}