Hi
I have a php project that i am working on and I need to get the last day of the month. How do I accomplish this in php?
Jamie from Washington DC
Hi
I have a php project that i am working on and I need to get the last day of the month. How do I accomplish this in php?
Jamie from Washington DC
Comments are closed.
Hi Jamie
You can use some of the build in functionality in php to easily solve this issue. In the formatting for a date field, t returns the number of days in the month of a given date. Therefore:
$a_date = "2009-11-23";
echo date("Y-m-t", strtotime($a_date));
Will echo “2009-11-30”