0

How to get first element of array in php using key and how to find first key of array?

3
  • Can you please provide code. Commented Dec 17, 2015 at 5:13
  • post what you tried? and what issues you faced Commented Dec 17, 2015 at 5:13
  • you can use key($array) Commented Dec 17, 2015 at 5:13

1 Answer 1

2

You can try this -

$key = array_shift(array_keys($yourArray));
echo $yourArray[$key];
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.