To get last day of month in php we will use This will return last day of given date 2019-01-31 How to get Last day of previous month? To get last date of previous month we will use below code ?php print_r($lastDay);
date("Y-m-t", strtotime($a_date)) method
Let's write example
?php
$a_date = "2019-01-23";
echo date("Y-m-t", strtotime($a_date));
?>
$lastDay = date('t',strtotime('last month'));
?>
How to Concatenate two arrays in PHP?
How to get last day of Month using PHP?
How to Remove White Space from a String in PHP
How to check php version of xampp in windows