title: Access PHP array element with a function?
body: <p>I'm working on a program that uses PHP's internal array pointers to iterate along a multidimensional array. I need to get an element from the current row, and I've been doing it like so:</p>
  
  <pre><code>$arr[key($arr)]['item']
  </code></pre>
  
  <p>However, I'd much prefer to use something like:</p>
  
  <pre><code>current($arr)['item'] // invalid syntax
  </code></pre>
  
  <p>I'm hoping there's a function out there that I've missed in my scan of the documentation that would enable me to access the element like so:</p>
  
  <pre><code>getvalue(current($arr), 'item')
  </code></pre>
  
  <p>or</p>
  
  <pre><code>current($arr)-&gt;getvalue('item')
  </code></pre>
  
  <p>Any suggestions?</p>