I have some code that calculates the date for the beginning of the previous week.
date("Y-m-d", time() - (date('w') - 1) * (60 * 60 * 24))
However, in MySQL, the date needs to be shifted back one day to grab the first day of the date.
Now, I have actually solved this problem.
$array_date = explode('-', date("Y-m-d", time() - (date('w') - 1) * (60 * 60 * 24)));
$array_search['start'] = date('Y-m-d', mktime(0, 0, 0, $array_date, $array_date - 1, $array_date));
But it's a kludge.
So this is more out of curiosity than anything else, I'd just like to know what would need to be done to the first code sample to add on that extra day at the beginning.
I've tried everything I can think of, so any solution would be much appreciated!