title: php to js array convert with jquery's ajax
body: <p>Im trying to convert 5 PHP arrays to 5 js arrays.</p>
  
  <p>I used to transfer php variables to js variables with json like this:</p>
  
  <pre><code>$return['variable'] = $variable;
  echo json_encode($return);
  </code></pre>
  
  <p>And then fetch it as json object on the js side like this:</p>
  
  <pre><code>success : function(data) {
  
      alert(data.variable);
  
  }
  </code></pre>
  
  <p>now things are a bit more complicated, i need to transfer these 5 php arrays from a php script to my js script as 5 js arrays:</p>
  
  <p>PHP arrays:</p>
  
  <pre><code>$i = 0;
  while ($location = mysql_fetch_array($get_locations)) {
  
      $location_full_name[$i] = $location['loc_full_name'];
      $location_main_name[$i] = $location['loc_main_name'];
      $location_sub_name[$i] = $location['loc_sub_name'];
      $location_anchor_id[$i] = $location['loc_anchor_id'];
      $location_type[$i] = $location['loc_type'];
  
      $i++;
  }
  </code></pre>
  
  <p>and fill these corresponding arrays:</p>
  
  <pre><code>var location_full_name = new Array();
  var location_main_name = new Array();
  var location_sub_name = new Array();
  var location_anchor_id = new Array();
  var location_type = new Array();
  </code></pre>
  
  <p>i dont know how to do this. hope i can get some help :)</p>
  
  <p>regards,
  alexander</p>