title: Using PHP variable as autocomplete source
body: <p>I've simplified the problem down as much as possible, I feel like this should work. The below script controls the autocomplete function and works as expected (if a user types 't', 'test' appears as a suggested input).</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function() {
      var availableClients = ['test'];
      $("#addClient").autocomplete({
          source: availableClients,
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>However, if I set a PHP variable $test = "'test'" and replace 'test' in the original script with <code>&lt;?php echo $test; ?&gt;</code> the autocomplete script no longer works. Is there another way I can use a PHP variable as the autocomplete source or am I missing something?</p>
  
  <p>EDIT: Here is the script with the PHP in it.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function() {
      var availableClients = [&lt;?php echo $test; ?&gt;];
      $("#addClient").autocomplete({
          source: availableClients,
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>And the only relevant PHP code is this.</p>
  
  <pre><code>$test = "'test'";
  </code></pre>