I have index.php file where i have a php array like this,
$arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5);
echo json_encode($arr);
and i want the $arr value in jquery function which is in another file named fetchvalue.js,
$(function () {
$('#barchart').sparkline(ARRAYFROMPHP, {
type: 'bar',
barColor: '#3B5998',
height:'35px',
weight:'96px'
});
});
Please help me out in this. I am new to php and JS.Thanks in advance.