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));
}

LinkWithin

Related Posts with Thumbnails