Syed Muhammad Zulqarnain Syed Muhammad Zulqarnain - 4 years ago 95
PHP Question

Understanding Date function Parameters in PHP

I am making a custom calendar in PHP Zend-framework2, from a web tutorial, but cannot understand what does the function parameters mean? Here is the code

$running_day = date('w',mktime(0,0,0,$month,1,$year));

are passed to this function, but don't understand what other parameters mean.
Any help would be appreciated, thanks in advance

Answer Source

mktime — Get Unix timestamp for a date. it's six parameters stand for hour minute second month day and year respectively.

date — Format a local time/date. It's first parameter accept format designator and 'w' will return a numeric representation of the day of the week which starts from 0 (0 for Sunday). It's second optional parameter is an integer Unix timestamp that defaults to the current local time if a timestamp is not given.

Please cheek PHP official documentation, you will get more detail.


miketime date

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download