Posted By

MarcelDillen on 01/20/11


Tagged

array keys


Versions (?)

Get first or last array key


 / Published in: PHP
 

  1. function get_first_key($array)
  2. {
  3. return reset(array_keys($array));
  4. }
  5.  
  6. function get_first_key($array)
  7. {
  8. return end(array_keys($array));
  9. }

Report this snippet  

You need to login to post a comment.