Possible Duplicate:
Get first day of week in PHP?
i have this script that give's me the beginning and the end of the current week:
$begweek = (date('l') == 'Monday')?date('Y-m-d'):date('Y-m-d',strtotime('last monday'));
echo $begweek;
echo "<br>";
$endweek = (date('l') == 'Sunday')?date('Y-m-d'):date('Y-m-d',strtotime('Sunday'));
echo $endweek;
what i need is a way to find the beginning and the end of any week if i pass a random date, like $date="2011-11-15"
;
an ideas on what i need to modify in the current script to accommodate this variable?
thanks