title: pass php array to jquery function
body: <p>I got a page with a form to fill it with custormers info. I got previous custormers data stored in a php array. With a dropdownlist  users can fill the form with my stored data.</p>
  
  <p>what i have is a jquery function that triggers when the  value changes and inside that function i whould like to update the form values with my stored data (in my php array).</p>
  
  <p>Problem is that i dont know how to pass my php array to the jquery function, any idea ?? </p>
  
  <p>this is how i fill the array:</p>
  
  <pre><code>$contador_acompanantes = 0;
  
  foreach ($acompanantes-&gt;Persona as $acomp) 
  {
    $numero = $acomp-&gt;Numero;
    $apellidos = $acomp-&gt;Apellidos;
    $nombre = $acomp-&gt;Nombre;
  
    $ACOMPANANTES[$contador_acompanantes] = $ficha_acomp;
    $contador_acompanantes++; 
  }
  </code></pre>
  
  <p>got my select object:</p>
  
  <pre><code>&lt;select name="acompanante_anterior" id="acompanante_anterior"&gt;
  &lt;option value="1" selected&gt;Acompañante&lt;/option&gt;
  &lt;option value="2"&gt;acompanante1&lt;/option&gt;
  &lt;option value="2"&gt;acompanante2&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>and this is my code for the jquery function (it is in the same .php page)</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() 
  { 
  $('#acompanante_anterior').on('change', function() 
      {
  
      });
  });
  &lt;/script&gt;
  </code></pre>