title: disabling particular date in input box using jquery in php not working
body: <p>i have a php website, there is a form which user can submit, i want to disable few dates if they are already present in database, so i did like below:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;input id="niy" name="idate" value=""/&gt;
  
   &lt;?php
      $queryusersz = "SELECT * FROM invoice";
      $dbz = mysqli_query($con, $queryusersz);
      while($row = mysqli_fetch_array($dbz)) {
     $names[] = $row['idate'];      
      ?&gt;
      
      &lt;script&gt;
      var array = &lt;?php $names ?&gt;;
  
  $('#niy').datepicker({
      language:'TR',
      beforeShowDay: function(date){
          var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
          return [ array.indexOf(string) == -1 ]
      }
  });
      &lt;/script&gt;
    &lt;?php }?&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>however the input box doesnt show date and neither i get any errors in console, can anyone please help me with this, thanks in advance.</p>