title: how to get single result from nested foreach
body: <p>I have a problem I've been trying to solve for two weeks now, please I need help on this. I do not understand using array well so please bear with me.</p>
  
  <p>I'm trying to combine two arrays and store them in one array so I did this.</p>
  
  <pre><code>$oldvalue =$_SESSION[oldmids]; //value example aa=1,bb=2,cc=3;
  $newvalue =$_SESSION[newmids]; //value example 001,002,003;
  
  
  $result =array();
  foreach($oldvalue as $oldval){
  
  $kk =explode('=',$oldval);//i want to keep my tagging so
  $oldtag =$kk[0];         // I use explode.
  
      foreach($newvalue as $newid){
          $kk =$oldtag.$newid;
          $result[] =$kk;
      }   
  }   
  
  //  print_r($result);
  </code></pre>
  
  <p>my goal here is to keep my old tag and replace with numeric value, I don't have a problem with
  the output, but I only need to get a unique value from my array $result. I tried using array_unique, but failed. Is this the right approach?</p>