title: Convert array to comma separated values
body: <p>I'm using PHP.</p>
  
  <p>I have the following array:</p>
  
  <pre><code>Array
  (
  [home] =&gt; 9
  [pets] =&gt; 8
  [dogs] =&gt; 7
  [shampoo] =&gt; 7
  [cover] =&gt; 6
  )
  </code></pre>
  
  <p>I want to create a comma separated list which is:</p>
  
  <pre><code>home,pets,dogs,shampoo,cover
  </code></pre>
  
  <p>Here's what I'm trying but giving me blank string (<code>$words</code> is the array):</p>
  
  <pre><code>$myWords = implode(',',$words[0]);
  </code></pre>
  
  <p>Do I need to loop instead?</p>