I'm using strtotime just fine for finding the previous week and next week's entries in my database, but what I can't seem to find is how to find the previous six days if the user selects a past date.
Here's how I know what today and six days previous are:
$today = date("Y-m-d");
$minus6 = date('Y-m-d', strtotime('-6 days'));
Now how can I switch $today with $dateString as provided by my users' input? I thought something like this based on my google searches, but it yields no results:
$dateString = 2010-01-25; // for example
$minus6 = date('Y-m-d', strtotime('-6 days, $dateString');
Am I missing some fundamental information regarding dates, strtotime, or what? Thanks for any help.