title: PHP array to JS array with jQuery and json_encode
body: <p>I just want to get my PHP array to a JS array, what am I doing wrong here?</p>
  
  <p>PHP:</p>
  
  <pre><code>// get all the usernames
  $login_arr = array();
  $sql = "SELECT agent_login FROM agents";
  $result = mysql_query($sql);
  while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
      array_push($login_arr, $row["agent_login"]);
  }
  $js_login_arr = json_encode($login_arr);
  print $js_login_arr; // ["paulyoung","stevefosset","scottvanderlee"] 
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var login_arr = "&lt;?= $js_login_arr; ?&gt;";
  alert(login_arr); // acn't even get the string in??
  var obj = jQuery.parseJSON(login_arr);
  </code></pre>