1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14.

Thursday, July 14, 2011

How to find end date of a given month in php

The following php function does the trick.
This function accepts argument as integer month and integer year

eg.findEndDate(2,2000);
eg.findEndDate(12,2011);

function findEndDate($month,$year)
{
return date('m-d-Y',mktime(0,0,0,$month+1,0,$year));
}

No comments:

Post a Comment

Related Posts with Thumbnails