Let's say I have this array:
$myArray = array(a, b, c, d, e, f, g);
And I have a start indicator, $startpos, whose possible value can be any value from 0 to myArray's number of elements.
So if $startpos = 0, the desired print result would be a, b, c, d, e, f, g
if $startpos = 2, the desired print result would be c, d, e, f, g, a, b
if $startpos = 5, the desired print result would be f, g, a, b, c, d, e
I've been searching a php built-in or custom function through SO (similar question at Treat an array as circular array when selecting elements - PHP) and having a look to http://www.w3schools.com/php/php_ref_array.asp but I'm not getting the desired result. Anyone could please give me a suggestion?