How to get the first item from an associative PHP array?

Posted by Click Upvote on Stack Overflow See other posts from Stack Overflow or by Click Upvote
Published on 2009-10-24T06:21:05Z Indexed on 2010/05/28 1:01 UTC
Read the original article Hit count: 185

Filed under:

If I had an array like:

$array['foo'] = 400;
$array['bar'] = 'xyz';

And I wanted to get the first item out of that array without knowing the key for it, how would I do that? Is there a function for this?

© Stack Overflow or respective owner

Related posts about php