Right, we're close!
If I include the var in the 2nd line I get a 500 server error.
With it removed it outputs the 52nd and final part of the array but not the full array, I've checked by changing the 52 to another number.
Code:
for ( $i = 1 ; $i <= 52 ; $i++ )
$marking[i] = strtotime((-1*$i).' week sunday') * 1000;
function convert_to_markings( $CurMarking )
{
return "{ xaxis: { from: ".($CurMarking).", to: ".($CurMarking-96400000)." }, color: \"#F3F3ED\" }";
}
$markings = array_map( "convert_to_markings" , $marking );
$markings = implode( "," , $markings );
Output from that is
Code:
{ xaxis: { from: 1425168000000, to: 1425071600000 }, color: "#F3F3ED" }
Please help Peter!