How can I set a date range value for each week that gets updated dynamically as time goes on. I want to start the week on Monday and end on Sunday.
Example output would need to be 2011-10-24,2011-10-31
Using the below I am only getting the date of the month vs YYYY-MM-DD
<?php
$today = getdate();
$weekStartDate = $today['mday'] - $today['mon']+1;
$weekEndDate = $today['mday'] - $today['wday']+7;
echo "week start date:".$weekStartDate;
echo "<br/>";
echo "week end date:".$weekEndDate;
?>
As mentioned in the comments, use
DateTime.