如何重置codeigniter alternator()函数

时间:2014-12-05 16:10:58

标签: php function codeigniter alternator

如何将交流发电机设置为其正常位置?

代码:

foreach($items as $item):
        foreach($sides as $side):
            echo alternator('Left', 'Right');
        endforeach;
        //I want the alternator to "restart" here and always start from the initial variable "Left" in this case
endforeach;

1 个答案:

答案 0 :(得分:1)

  

Note: To use multiple separate calls to this function simply call the function with no arguments to re-initialize.

foreach($items as $item):
        foreach($sides as $side):
            echo alternator('Left', 'Right');
        endforeach;
        alternator();
endforeach;