How to build this kind of Logic using arrays in PHP
<p>I have an array which consists of this set of items </p>

<pre><code>array(3) {
  [0]=&gt;
  array(4) {
    ["Field1"]=&gt;
    string(8) "80000007"
    ["Field2"]=&gt;
    string(16) "O70000006"
    ["Field3"]=&gt;
    string(0) ""
    ["Field4"]=&gt;12345
    string(0) ""
   }
  [1]=&gt;
  array(4) {
    ["Field1"]=&gt;
    string(8) "80000008"
    ["Field2"]=&gt;
    string(16) "O70000007"
    ["Field3"]=&gt;
    string(0) ""
    ["Field4"]=&gt;78965
    string(0) ""
  }
  [2]=&gt;
   array(4) {
    ["Field1"]=&gt;
    string(8) "80000009"
    ["Field2"]=&gt;
    string(16) "H80000006"
    ["Field3"]=&gt;
    string(0) ""
    ["Field4"]=&gt;12345
    string(0) ""
  }
}
</code></pre>

<p>Now my question is   Iam trying to display only the items once    from array or trying to filter  the array in such a way  if the "Field2"  has
 a value starting with "O"  or "H"    and their  "Field4 "  value  should be different    . If the "Field4" value is same for the each of the row
 then we dont display that row or array item . For eaxample  from the above array  we will get 2 items as follows </p>

<blockquote>
  <p>1)80000007  O70000006  12345<br />
  2)80000008  O70000007   78965</p>
  
  <p>//we are not displaying the 3rd Item
  because The "Field4 " is same . we
  display only once</p>
</blockquote>

<pre><code> foreach ($resultset  as $key =&gt; $value){           
            echo $key."&lt;br&gt;"; ///  outputs 0,1,2
            echo $value['Field2']."&lt;br&gt;"; // outputs O70000006, O70000007, H80000006
}
</code></pre>
