title: How to pass PHP array parameter to Javascript Function?
body: <p><b><code>index.php</code></b></p>
  
  <pre><code>&lt;script type="text/javascript" src="javascript.js"&gt; &lt;/script&gt;
  &lt;?php
   $movies = array("Bloodsport", "Kickboxer", "Cyborg", "Timecop", "Universal Soldier", "In Hell", "The Quest");
  ?&gt;
  
  &lt;input type="submit" value="Test Javascript" onclick="showMovies(&lt;?php echo $movies; ?&gt;);" /&gt;
  </code></pre>
  
  <p><br /></p>
  
  <p><b><code>javascript.js</code></b></p>
  
  <pre><code>function showMovies(movies) {
   alert(movies.length);
  
   return false;
  }
  </code></pre>
  
  <p>I am new to programming so Im having hard time fixing this one which is obviously simple for you guys. </p>
  
  <p>When I hit the submit button it says the that the array size is 1 which I think should be 7. How could this be?</p>