title: Distinct values from while loop
body: <p>I have a database with a field called part_name.
  with the values: </p>
  
  <pre><code>Front Control Arm, Rear Control Arm
  </code></pre>
  
  <p>I need to echo out only Control Arm, once only. 
  As of now what i'm getting on the while loop results is </p>
  
  <pre><code>Control Arm, Control Arm.
  </code></pre>
  
  <p>Need to echo out distinct values from while loop results. I can't do it on the SQL query <code>SELECT DISTINCT</code> because i'm preg replacing the value from the row that i'm queering on the database. </p>
  
  <pre><code>while ($rowsparts = mysql_fetch_array($displayparts))    {
       $part=''.$rowsparts['part_name'].''; 
       $part = preg_replace('/\bFront\b/u', '', $part);
       $part = preg_replace('/\bRear\b/u', '', $part);  
       echo '&lt;li&gt;'.$part.'&lt;/li&gt;';
  }
  </code></pre>
  
  <p>I need to echo out the $part variable distinct values, only once per part name.</p>
  
  <p>Control Arm only.</p>