This is a discussion on getting month and year from a date within the PHP Language forums, part of the PHP Programming Forums category; Hello, Using PHP 4, how would i Extract the numeric month and year from a date variable created using the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
laredotornado@zipmail.com wrote:
> Using PHP 4, how would i Extract the numeric month and year from a > date variable created using the date() function? > With date: list($year, $month) = explode('-', date('Y-n')); With getdate: $date = getdate(); $year = $date['year']; $month = $date['mon']; JW |