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
{ xaxis: { from: 1425168000000, to: 1425071600000 }, color: "#F3F3ED" }
...of an idiot who doesn't know what things are. :S
Hmm, bit harsh? Maybe just a dunce. (hug)
jQuery neither prefixes variable names not puts dollars in front of selectors. It aliases itself as $, and as a function it can have arguments, the first of which can be a selector, though it also can be other things, and also has various methods attached to the function's object itself.
Which is not to say it isn't a bit dumb, but it is at least more convenient than typing case sensitive jQuery, though even that isn't as $durbrained $as $bloody $_PHP.