How would it be possible to pass a variable into a date string? I have the following variables:
$start_date = date('2014-01-01');
$end_date = date('2014-12-31');
But now I am adding it to a loop where the year (2014) will change each time through, and I have that new year assigned as:
$dateArr[0];
But when I try to do this it doesn't work:
$start_date = date('$dateArr[0]-01-01');
$end_date = date('$dateArr[0]-12-31');
How could I work this syntax to pass a variable into a date string?