title: PHP - Delete all duplicates in array
body: <p>How can I delete duplicates from multiple arrays?  </p>
  
  <p><code>pinky</code> and <code>cocos</code> are double in my array. All words which are  double, must be removed. If those are removed, I will put these words in my select.
  I get those words from my database.</p>
  
  <p>The query:</p>
  
  <pre><code>$queryClient = " SELECT DISTINCT `clients` FROM `reps` WHERE `clients` != ''";
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>while($row =  mysql_fetch_assoc($resultClient)){
      $names = explode(",", $row['clients']);
      echo '&lt;pre&gt;'; print_r($names); echo '&lt;/pre&gt;';
  }
  </code></pre>
  
  <p>Result:  (Those food words are just an example) </p>
  
  <pre><code>Array
      (
          [0] =&gt; chocolate
      )
      Array
      (
          [0] =&gt; vanilla
          [0] =&gt; cocos
      )
      Array
      (
          [0] =&gt; strawberry
      )
      Array
      (
          [0] =&gt; pinky
          [1] =&gt; watermelon
          [2] =&gt; melon
          [3] =&gt; cocos
      )
      Array
      (
          [0] =&gt; pinky 
      )
      Array
      (
          [0] =&gt; dark-chocolate
      )
  </code></pre>
  
  <p>I tried this in my while loop but it did not work:</p>
  
  <pre><code>$array = array_unique($names, SORT_REGULAR);
  </code></pre>
  
  <p>How can I remove all duplicates? Can you help me or do you have a solution for my problem? Help.</p>