Skip to content

Instantly share code, notes, and snippets.

@Narven
Created May 1, 2013 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Narven/5495448 to your computer and use it in GitHub Desktop.
Save Narven/5495448 to your computer and use it in GitHub Desktop.
If you get from a result of something an array... and might not come always with 0 as the first key, like array[0]... or array[20] u can use this snippet to get always the first key.
reset($array);
$first_key = key($array);
var_dump($array[$first_key]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment