Created
May 1, 2013 14:06
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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