crazymao Posted August 14, 2011 Share Posted August 14, 2011 I would like to get the key from an array at a specific point, I know that there is a key() function but the syntax does not apply to my situation, it works like key($array) but what I want is more like key($array[2]) Thanks alot Link to comment https://forums.phpfreaks.com/topic/244778-get-key-from-array-at-specific-point/ Share on other sites More sharing options...
jcbones Posted August 14, 2011 Share Posted August 14, 2011 $keys = array_keys($arr); echo $keys[2]; http://php.net/manual/en/function.array-keys.php Link to comment https://forums.phpfreaks.com/topic/244778-get-key-from-array-at-specific-point/#findComment-1257292 Share on other sites More sharing options...
crazymao Posted August 14, 2011 Author Share Posted August 14, 2011 thanks alot! Link to comment https://forums.phpfreaks.com/topic/244778-get-key-from-array-at-specific-point/#findComment-1257298 Share on other sites More sharing options...
jcbones Posted August 14, 2011 Share Posted August 14, 2011 Your Welcome! Link to comment https://forums.phpfreaks.com/topic/244778-get-key-from-array-at-specific-point/#findComment-1257301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.