Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Location
    Northbrook, IL
    Posts
    394
    Thanks
    8
    Thanked 6 Times in 6 Posts

    Question positioning the internal array pointer manually?

    i know you can move the the pointer with next() and prev() relative to current location. and use reset() or end() to move them to beginning or end.

    but is there a way of positioning the internal array pointer manually (to a specified associative key) without looping through the array manually and doing a key check?

    perhaps some redundant operation like assigning an array value to itself would also work....anything that can place the pointer to the needed index/key.

    thanks,
    Leon

  • #2
    Regular Coder
    Join Date
    May 2008
    Location
    Ohio
    Posts
    231
    Thanks
    3
    Thanked 21 Times in 21 Posts
    I don't think you can do this - you'll probably need to loop through the array. That shouldn't be too much of a problem if it's a small array - php is faster than people give it credit for.
    zok@zoklet:~$ whereis zok
    zok: http://zoklet.net | http://zoklet.net/otg | /derzok/at/gmail/dot/com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •