Hi guys!

I have some code that calculates the date for the beginning of the previous week.

PHP Code:
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.

PHP Code:
$array_date explode('-'date("Y-m-d"time() - (date('w') - 1) * (60 60 24)));
$array_search['start'] = date('Y-m-d'mktime(000$array_date[1], $array_date[2] - 1$array_date[0])); 
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!