Task: Get the last day of the current month.
Used PHP Functions:
Let us see the example
<?php
$date = '2020-04-23';
// Last date of current month.
$last_date = strtotime(date("Y-m-t", $date ));
// Day of the last date
$day_last = date("l", $lastdate);
echo $day_last;
?>
0
0
Try this if you are using PHP 5.*
<?php
$current_date = date('Y-m-d');
$date = new DateTime($current_date);
$date->modify('last day of this month');
echo $date->format('Y-m-d');
?>
0
0
Please Login to Post the answer