title: PHP Select key in multi-dimentional array
body: <p>I am working on a project where I select multiple items from a database (say 20) and store them in the cache in an array. I then need to remove the item from the array when the user clicks on the item.</p>
  
  <p>Rather than deleting the cache and re-firing the query every time this happens (which was suggested by a colleague) I would like to simply remove the item from the cache and only re-fire the query when there are a limited number of items in the cache (say 5)</p>
  
  <p>The array coming from the cache looks like this:</p>
  
  <pre><code>[
      [
        'item_id' =&gt; 10001,
        'item_name' =&gt; "super-cool item",
        'item_description' =&gt; "This item is awesome"
      ],
      [
        'item_id' =&gt; 10002,
        'item_name' =&gt; "super-cool item",
        'item_description' =&gt; "This item is awesome"
      ],
      [
        'item_id' =&gt; 10003,
        'item_name' =&gt; "super-cool item",
        'item_description' =&gt; "This item is awesome"
      ]
  ]
  </code></pre>
  
  <p>The array gets shuffled before three items are selected and shown to the user.</p>
  
  <p>Obviously what I need to do is select an item based on the <code>item_id</code>, unset that item's key and reset the field in the cache.</p>
  
  <p>The part that is tripping me up is selecting the item based on <code>item_id</code>, so what is the most efficient way of doing this?</p>