NYCPHP Meetup

NYPHP.org

[nycphp-talk] Accessing First Element of Array

Mark Armendariz lists at enobrev.com
Sun Aug 26 21:42:36 EDT 2007


Paul M Jones wrote:
> On Aug 26, 2007, at 7:54 PM, Jon Baer wrote:
>
>> Is it anything that $array[0] would not be able to get access to?
>
> The function `current($array)` should do the trick.  Make sure you do 
> so before trying to loop through the array or anything. ;-)
Or just reset before using it.
|reset($array);
echo current($array)

|http://php.net/reset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070826/6526843b/attachment.html>


More information about the talk mailing list