Grabbing specific months first date and lastdate in PHP
<pre><code>function firstOfMonth() {
return date("m/d/Y", strtotime(date('m').'/01/'.date('Y').' 00:00:00'));
}

function lastOfMonth() {
return date("m/d/Y", strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00'))));
}
</code></pre>

<p>is what i have to get the current month's first day date and last day date.</p>

<p>Now i wish to change it alittle, so in both functions they have a param with $month, where $month holds the number of the month I would like to get the first date and last date from.</p>

<p>Example if i do firstOfMonth(1), I would like it to return 2012-01-01 and lastOfMonth(1) it should return 2012-01-31</p>

<p>How can i do this?</p>
