I’m looking for a way to make the prev() function to keep rewinding (starting from the end instead) when used on the first index. Consider the following example:
$foo = array(1, 2, , ..., 12);
echo current($foo) // output: 1
echo prev($foo) // should output 12 - returns FALSE
I could, of course, write a function to somehow satisfy my needs, but I’m pretty sure that I must be overlooking something since this is pretty simple behavior.
Do you think something like this?