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