View Full Version : positioning the internal array pointer manually?

08-06-2008, 09:50 PM
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.


08-07-2008, 02:45 PM
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.