help me to understand this simple php code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
himalaya73
Forum Newbie
Posts: 2
Joined: Sat Jan 24, 2009 7:05 pm

help me to understand this simple php code

Post 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!!!!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: help me to understand this simple php code

Post 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.)
Post Reply