title: filter array by key
body: <p>I have this little function to filter my array by keys:</p>
  
  <pre><code> private function filterMyArray( )
   {
        function check( $v )
        {
             return $v['type'] == 'video';
        }
        return array_filter( $array, 'check' );
   }
  </code></pre>
  
  <p>This works great but since I have more keys to filter, I was thinking in a way to pass a variable from the main function: <code>filterMyArray($key_to_serch)</code> without success, also I've tried a global variable, but seems not work.</p>
  
  <p>Due some confusion in my question :), I need something like this:</p>
  
  <pre><code> private function filterMyArray( $key_to_serch )
   {
        function check( $v )
        {
             return $v['type'] == $key_to_serch;
        }
        return array_filter( $array, 'check' );
   }
  </code></pre>
  
  <p>Any idea to pass that variable?</p>