How to find the last day of the month from date in php?

How can I get the last day of the month in PHP?

 $a_date = "2009-11-23"  

I want last day of the month like 2009-11-30

 string date ( string $format [, int $timestamp = time() ] )  

Date function has format string "t", returns the number of days in the month of a given date (see the date document)

 $a_date = "2009-11-23";  
 echo date("Y-m-t", strtotime($a_date));  

Nikunj K

Phasellus facilisis convallis metus, ut imperdiet augue auctor nec. Duis at velit id augue lobortis porta. Sed varius, enim accumsan aliquam tincidunt, tortor urna vulputate quam, eget finibus urna est in augue.