title: Implode Multi Dimensional Array to a single comma separated list in PHP
body: <p>If I have an array like: </p>
  
  <pre><code>Array ( [0] =&gt; abcdef )
  Array ( [0] =&gt; abcdef [1] =&gt; abcdef )
  Array ( [0] =&gt; abcdef [1] =&gt; abcdef [2] =&gt; abcdef )
  Array ( [0] =&gt; abcdef [1] =&gt; qwerty ) 
  </code></pre>
  
  <p>And want to create a comma separated list like: </p>
  
  <pre><code>abcdef, abcdef, abcdef, abcdef, abcdef, abcdef, abcdef, qwerty
  </code></pre>
  
  <p>How would I do this? </p>
  
  <p>When I try and implode the array like this:  </p>
  
  <pre><code>while($row = mysql_fetch_array($search)){ 
      $row2 = $row['scholarshipid']; 
      $newarray = unserialize($row2);
      $unique_array = array_unique($newarray, SORT_REGULAR);
      $commaList = implode(', ', $unique_array);
      echo "$commaList";
      //print_r($newarray); 
  } 
  
  $commaList = implode(', ', $unique_array);
  </code></pre>
  
  <p>I get: </p>
  
  <pre><code>abcdefabcdefabcdefabcdef, qwerty
  </code></pre>