How can I get the last day of the month in PHP?
Given:
$a_date = \"2009-11-23\"
I want 2009-11-30; and given
$a_dat
If you use the Carbon API extension for PHP DateTime, you can get the last day of the month with:
$date = Carbon::now(); $date->addMonth(); $date->day = 0; echo $date->toDateString(); // use toDateTimeString() to get date and time