title: Combine all values and remove duplicates
body: <p>How combine this array and remove duplicate values?
  Thank you!</p>
  
  <pre><code>  array (size=17)
    0 =&gt; string 'Black' (length=5)
    1 =&gt; string 'Blue' (length=4)
    2 =&gt; string 'Burgundy' (length=8)
    3 =&gt; string 'Glow' (length=4)
    4 =&gt; string 'Granite' (length=7)
    5 =&gt; string 'Green' (length=5)
    6 =&gt; string 'Lime' (length=4)
    7 =&gt; string 'Natural' (length=7)
    8 =&gt; string 'Orange' (length=6)
    9 =&gt; string 'Pink' (length=4)
    10 =&gt; string 'Purple' (length=6)
    11 =&gt; string 'Red' (length=3)
    12 =&gt; string 'Silver' (length=6)
    13 =&gt; string 'Teal' (length=4)
    14 =&gt; string 'Violet' (length=6)
    15 =&gt; string 'White' (length=5)
    16 =&gt; string 'Yellow' (length=6)
  </code></pre>
  
  <p>Thank you, your code worked perfectly. </p>
  
  <p>I'm still missing something because I don't get what I want. </p>
  
  <p>The values (color names) are in the select form, but when a value other than 'Filter by Color' is selected, the 'id' is what pass instead of the 'text'. To make things easy, here is the complete code.</p>
  
  <p>Thank you.</p>
  
  <pre><code>$Sql_product_colors = ("SELECT COUNT(p.products_id) AS id, pia.product_filter_colors FROM products p LEFT JOIN products_imprint_areas pia on p.products_id = pia.products_id
           WHERE p.products_id &gt; '1'
           AND pia.product_filter_colors IS NOT NULL
           GROUP BY product_filter_colors
           ORDER BY product_filter_colors asc");
           $sort_list_colors = array();
           $product_filter_colors = tep_db_query($Sql_product_colors) or die(mysql_error());
  
  while ($row = mysql_fetch_array($product_filter_colors)) {
      $arrColor = explode(',', $row[1]);                             
      $arrColors=array_filter(array_map('trim', $arrColor));          
      $sort_list_color = array_merge($sort_list_colors,$arrColors); 
      $sort_list_colors = array_unique($sort_list_color);
      sort($sort_list_colors);
        }
                      $sort_list_colors[0] ='Filter by Color';
                      $sort_list_colors[] ='&amp;nbsp;&amp;nbsp;'.$row[$sort_list_colors].' &amp;nbsp;&amp;nbsp;(' .$sort_list_colors['count'].')';
  
          if(count($sort_list_colors)&gt;0)
                   {
                       foreach($sort_list_colors as $id=&gt;$text) {
                        $sort_range_colors[] = array('id' =&gt; $id, 'text' =&gt; $text);
                       }
                   }
  // -------------------------------------- Select form
          echo '&lt;td align="center" width="25%" valign="middle"&gt;&lt;div class="styled-select"&gt;' . tep_draw_form('colors_sort', htmlentities($_SERVER['PHP_SELF']), 'get') . '';
          echo tep_draw_pull_down_menu('colors_sort', $sort_range_colors, (isset($HTTP_GET_VARS['colors_sort']) ? $HTTP_GET_VARS['colors_sort'] : ''), 'onchange="this.form.submit()"');
          echo '&lt;/form&gt;&lt;/div&gt;&lt;/td&gt;';
  </code></pre>
  
  <p>This is the function tep_draw_pull_down_menu. Thank you.</p>
  
  <pre><code> function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
      $field = '&lt;select name="' . tep_output_string($name) . '"';
      if (tep_not_null($parameters)) $field .= ' ' . $parameters;
      $field .= '&gt;';
      if (empty($default) &amp;&amp; isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);
      for ($i=0, $n=sizeof($values); $i&lt;$n; $i++) {
        $field .= '&lt;option value="' . tep_output_string($values[$i]['id']) . '"';
        if ($default == $values[$i]['id']) {
          $field .= ' SELECTED';
        }
        $field .= '&gt;' . tep_output_string($values[$i]['text'], array('"' =&gt; '&amp;quot;', '\'' =&gt; '&amp;#039;', '&lt;' =&gt; '&amp;lt;', '&gt;' =&gt; '&amp;gt;')) . '&lt;/option&gt;';
      }
      $field .= '&lt;/select&gt;';
      if ($required == true) $field .= TEXT_FIELD_REQUIRED;
      return $field;
    }
  </code></pre>