title: Store value of php array variable to javascript array variable
body: <p>i have some problem, how to store value of php array variable to javascript array variable because i want to manipulate data in javascript
  here's my code</p>
  
  <pre><code>&lt;?php  
  $coor= array('-7.175993,112.650729|-7.17616,112.651139|-7.176591,112.650968|-7.176413,112.650552|-7.176104,112.650437','-7.176331,112.649924|-7.17632,112.650053|-7.176629,112.650048|-7.176629,112.649914');
  ?&gt;
  </code></pre>
  
  <p>And i want to store all the values from $coor to var allcoor = new Array(), what i've been trying is use json_encode</p>
  
  <pre><code>&lt;script&gt;
  var allcoor=new Array();
  allcoor = "&lt;?php foreach ($cobadeh as $t){echo json_encode($t);} ?&gt;";
  //for some example of manipulation array variable javascript
  mySplitResult = allcoor[0].split("|");
  ...
  &lt;/script&gt;
  </code></pre>
  
  <p>What I want is manipulation of javascript array variable, and that code didn't work, can anyone help? </p>