title: Call PHP function from Javascript and return an array
body: <p>i have this in JAVASCRIPT , a.php -</p>
  
  <pre><code>function gettemplate(realnam) {
  </code></pre>
  
  <p>alert(realnam)
      }           </p>
  
  <p>i want to pass all the a[] array in func_a.php to the first file a.php.. to use the array there in javascript .
  how i do that?
  thanks a lot</p>
  
  <p>EDIT--
  ITS WORKS ! , if anyone need --</p>
  
  <pre><code>$a= json_encode($a);
      echo "&lt;SCRIPT LANGUAGE='javascript'&gt; gettemplate('$a');&lt;/SCRIPT&gt;\n";
  </code></pre>
  
  <p>:)</p>