title: PHP - Select an entire array containing a particular value
body: <p>I have a following array:</p>
  <pre><code>array(4){ 
  [0]=&gt; array(4){ 
  [&quot;id&quot;]=&gt; int(1) 
  [&quot;item_name&quot;]=&gt; string(8) &quot;Oilspill&quot; 
  [&quot;requests_count&quot;]=&gt; int(0) 
  [&quot;item_information&quot;]=&gt; string(21) &quot;Just some spilled oil&quot;
  } 
  [1]=&gt; array(4){ 
  [&quot;id&quot;]=&gt; int(2) 
  [&quot;item_name&quot;]=&gt; string(3) &quot;Fan&quot; 
  [&quot;requests_count&quot;]=&gt; int(0) 
  [&quot;item_information&quot;]=&gt; string(12) &quot;Standart fan&quot; 
  }
  [2]=&gt; array(4){ 
  [&quot;id&quot;]=&gt; int(3) 
  [&quot;item_name&quot;]=&gt; string(12) &quot;Green candle&quot; 
  [&quot;requests_count&quot;]=&gt; int(0) 
  [&quot;item_information&quot;]=&gt; string(16) &quot;Smells like moss&quot;
  }
  [3]=&gt; array(4){ 
  [&quot;id&quot;]=&gt; int(4) 
  [&quot;item_name&quot;]=&gt; string(8) &quot;Yin Yang&quot; 
  [&quot;requests_count&quot;]=&gt; int(0) 
  [&quot;item_information&quot;]=&gt; string(22) &quot;Ancient Chinese symbol&quot;
  } 
  </code></pre>
  <p>Is it possible to select an entire array that contains the id value I'm looking for?</p>
  <p>For example: I want an item with id=2, the output would be:</p>
  <pre><code>[1]=&gt; array(4){ 
  [&quot;id&quot;]=&gt; int(2) 
  [&quot;item_name&quot;]=&gt; string(3) &quot;Fan&quot; 
  [&quot;requests_count&quot;]=&gt; int(0) 
  [&quot;item_information&quot;]=&gt; string(12) &quot;Standart fan&quot; 
  }
  </code></pre>