$repeat = ['one', 'two', 'three', 'four'];
$key = 0;
$x = 0;
while($x <= 27) {
echo "{$repeat[$key]}<br/>";
$key = ++$key % count($repeat); // reset to zero when length is met
$x++;
}
Created
January 13, 2023 23:29
-
-
Save webrobert/28d3964ed392ca81e0809517e2878f7b to your computer and use it in GitHub Desktop.
reset to zero at length
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment