How to read an array in PHP inside JavaScript? Like this
<?php
$f(0)=69;
$f(1)=8;
$f(2)=25;
$f(3)=5;
$f(4)=32;
?>
<script>
var barChartData = {labels : ["Ene","Feb","Mar","Abr","May","Jun","Jul"],
datasets : [
{
fillColor : "#e64608", strokeColor : "#e64608",
data:[65,59,90,81,56,55,40]
},
{
fillColor : "#acadb1", strokeColor : "#acadb1", data :
[28,48,40,19,96,27,100]
}
]
}
var myLine = new
Chart(document.getElementById("bar").getContext("2d")).
Bar(barChartData);
</script>
I would like to replace the "data" in the data with the ones in the PHP array.