title: php get 1st value of an array (associative or not)
body: <p>This might sounds like a silly question. How do I get the 1st value of an array without knowing in advance if the array is associative or not?</p>
  
  <p>In order to get the 1st element of an array I thought to do this:</p>
  
  <pre><code>function Get1stArrayValue($arr) { return current($arr); }
  </code></pre>
  
  <p>is it ok?
  Could it create issues if array internal pointer was moved before function call?
  Is there a better/smarter/fatser way to do it?</p>
  
  <p>Thanks!</p>