I have this code
Code: PHP
$marking0 = strtotime('sunday') * 1000;
$marking0a = $marking0 - 96400000;
$marking0 = $marking0 + 10000000;
$marking1 = strtotime('-1 week sunday') * 1000;
$marking1a = $marking1 - 96400000;
$marking1 = $marking1 + 10000000;
$markings = "
{ xaxis: { from: $marking0, to: $marking0a }, color: \"#F3F3ED\" },
{ xaxis: { from: $marking1, to: $marking1a }, color: \"#F3F3ED\" }
" ;
I need the same thing 52 times eg
Code:
$marking2 = strtotime('-2 week sunday') * 1000;
$marking2a = $marking2 - 96400000;
$marking2 = $marking2 + 10000000;
$marking3 = strtotime('-3 week sunday') * 1000;
$marking3a = $marking3 - 96400000;
$marking3 = $marking3 + 10000000;
......
$marking52 = strtotime('-52 week sunday') * 1000;
$marking52a = $marking52 - 96400000;
$marking52 = $marking52 + 10000000;
$markings = "
{ xaxis: { from: $marking0, to: $marking0a }, color: \"#F3F3ED\" },
{ xaxis: { from: $marking1, to: $marking1a }, color: \"#F3F3ED\" },
{ xaxis: { from: $marking2, to: $marking2a }, color: \"#F3F3ED\" },
{ xaxis: { from: $marking3, to: $marking3a }, color: \"#F3F3ED\" },
.......
{ xaxis: { from: $marking52, to: $marking52a }, color: \"#F3F3ED\" }
" ;
There must be a pretty simple way to generate 52 of those without doing it all manually?