I have this PHP Code...
foreach($valoresa as $cada)
$listaDatos[$c++] = array('Date.UTC(' . date("Y", strtotime($cada['reading_date'])) . ',' . date("m", strtotime($cada['reading_date'])) . ',' . date("d", strtotime($cada['reading_date'])) . ',' . date("H", strtotime($cada['reading_date'])) . ',' . date("i", strtotime($cada['reading_date'])) . ',' . date("s", strtotime($cada['reading_date'])) . ')', floatval($cada['value']));
Then mixing JS and PHP:
{
name: '<?php echo $nombreDato; ?>',
yAxis: <?php echo $yAxis++; ?>,
data: <?php echo json_encode($listaDatos); ?>
},
This is the result:
data: [["Date.UTC(2013,06,26,16,03,35)",0],["Date.UTC(2013,06,26,16,04,35)",1],["Date.UTC(2013,06,26,16,06,35)",0]]
I want this: (Without any quote)
data: [[Date.UTC(2013,06,26,16,03,35),0],[Date.UTC(2013,06,26,16,04,35),1],[Date.UTC(2013,06,26,16,06,35),0]]
Why am I do this? If I do something like this:
foreach($valores01 as $cada)
$listaDatos[$c++] = array(strtotime($cada['reading_date']) * 1000, floatval($cada['value']));
The highcharts is recognizing the data date, 2 hours earlier than original, and I just want to test with Date.UTC() because original examples of highcharts do it like this: http://jsfiddle.net/JNkRR/
FIXED:
I fixed with the @nnnnnn tip, it very simple, i was thinking about a any json php function or something, but it was simplier using str_replace() php function:
<?php
$datosFinales = json_encode($listaDatos);
?>
{
name: '<?php echo $nombreDato; ?>',
yAxis: <?php echo $yAxis++; ?>,
data: <?php echo str_replace("\"", "", $datosFinales); ?>
},
"to an empty-string.