Page 1 of 1

help me to understand this simple php code

Posted: Mon Jan 26, 2009 11:20 pm
by himalaya73
I'm documenting some programs that contains the following PHP code:

function getLastDayOfMonth3($month, $year) {
return date('d', mktime(0, 0, 0, ($month + 1), 0, $year));
}


it's invoked on some point of the programs:

$last_day=getLastDayOfMonth3($month_proc,$year_proc);

The big question (don't laugh please), is what is does this function? does it return the last day of the month for a given month and year?

Thanks a lot for your help!!!!

Re: help me to understand this simple php code

Posted: Mon Jan 26, 2009 11:37 pm
by requinix
Judging by the name "getLastDayOfMonth" I would have to conclude that it determines what the last day of a month is.
Or in other words, how many days there are in a certain month.

(Looking at the code confirms that.)