title: PHP / JS - Send values from php to a js array
body: <p>I have a php array "$values", i want to transfer its values to a js array, which is working well, the only problem i'm getting is that it's making the 2 values sended stuck together as "onetwo" while i want them to be as two different values ["one","two"] in my Js array.</p>
  
  <pre><code>&lt;?php 
    $values= ["one", "two"];
  ?&gt;
  
  &lt;script&gt;
  var Js_array = [];
  
      Js_array.push('&lt;?php 
  
          for ($x = 0; $x &lt; count($values); $x++) {
              echo $values[$x];
          } 
      ?&gt;'); 
  
  alert(Js_array);
  &lt;/script&gt;
  </code></pre>
  
  <p>Thanks for your help.</p>