cycle through array
0
This functions cycles through array values. Can be used for creating table rows, for example.
<?php
function cycle($a) {
static $pointer = 0;
$values = array_values($a);
$pointer %= count($values);
return $values[$pointer++];
}
?>






There are currently no comments for this snippet.