I am using the following code which forms part of a mssql query and part of the filenames.[PHP]$month = date('Y-m',strtotime('-1 month'));
$starts = array($month.'-01',$month.'-16');
$ends = array($month.'-15',$month.'-31');[/PHP] This creates arrays such as
Expand|Select|Wrap|Line Numbers
- Array 0=>2007-09-01,1=>2007-09-16);
- Array 0=>2007-09-15,1=>2007-09-31).
What additional code do I need to always generate the the last day of the previous month,
ie 31 for Jan, 28 for Feb (poss leap year problem) 30 for Apr etc
Thanks