PHP Gets the date and week code for the next seven days
for ($i =4; $i <8; $i + +) {
$dateArray [$i]=date (' y-m-d ', strtotime (date (' y-m-d '). ' + '. $i. ' Day '))
};
$b =array ();
foreach ($dateArray as $key = = $value) {
$b []=array (' id ' = = $key, ' date ' = $value)
};
foreach ($b as $k = = $v) {
$b [$k] [' Week ']=get_week ($v [' Date ']);
$b [$k] [' Date ']=substr ($v [' Date '],5);
}
function Get_week ($date) {
$date _str=date (' y-m-d ', Strtotime ($date));
$arr =explode ("-", $date _str);
$year = $arr [0];
$month =sprintf ('%02d ', $arr [1]);
$day =sprintf ('%02d ', $arr [2]);
$hour = $minute = $second = 0;
$strap = Mktime ($hour, $minute, $second, $month, $day, $year);
$number _wk=date ("W", $strap);
$WEEKARR =array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
return $WEEKARR [$number _WK];
}
PHP Gets the date and week of the next seven days