How do I set the current array element to a particular key? For example, in:
$array (
0 => "zero",
1 => "one",
2 => "two"
)
I've performed this action:
$mykey = array_search('one', $array); // $mykey now = 1
I want to set the current element to $mykey so that I can use:
prev($array); // or next($array);
to call the previous or next array value.
(If there's a simpler way of doing the whole thing than starting with array_search(), I'm open to that too.)