title: Pass PHP array to Javascript variable
body: <p>php file</p>
  
  <pre><code>$querySelectWordFilter = "SELECT * FROM badwordfilter";
        $stmtSelectWordFilter = $conn-&gt;prepare($querySelectWordFilter);
        $stmtSelectWordFilter-&gt;execute();
        while($rowSelectWordFilter = $stmtSelectWordFilter-&gt;fetch()){
           $Array[] = $rowSelectWordFilter["filterWord"];
        }
  
      foreach($Array as $val){
           echo $val;
      }
  </code></pre>
  
  <p>Javascript file</p>
  
  <pre><code>&lt;script&gt;
   var filter = ['ass', 'evil','ugly'];
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Question : Firstly,I select all the value from database and store it into array.But how can i pass the PHP array variable into JavaScript filter variable?</strong></p>