title: Get the sub array in a bidimensional array having a particular key/value pair
body: <p>I have a large PHP array, similar to:</p>
  
  <pre><code>$list = array(
      array(
          'id'     = '3243'
          'link'   = 'fruits'
          'lev'    = '1'
      ),
      array(
          'id'     = '6546'
          'link'   = 'apple'
          'lev'    = '2'
      ),
      array(
          'id'     = '9348'
          'link'   = 'orange'
          'lev'    = '2'
      )
  )
  </code></pre>
  
  <p>I want to get the sub-array which contains a particular <code>id</code>.</p>
  
  <p>Currently I use the following code:</p>
  
  <pre><code>$id = '3243'
  foreach ($list as $link) {
      if (in_array($id, $link)) {
          $result = $link;
      }
  }
  </code></pre>
  
  <p>It works but I hope there is a better way of doing this.</p>