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
I know this is a little bit late but i think there is a more elegant way of doing this with PHP 5.3+ by using the DateTime class :
PHP 5.3+
$date = new DateTime('now'); $date->modify('last day of this month'); echo $date->format('Y-m-d');