标签:
1.current
<?php
$transport = array(‘foot‘, ‘bike‘, ‘car‘, ‘plane‘);
$mode =
current($transport); //$mode = ‘foot‘;
$mode = next($transport); // $mode
=‘bike‘;
$mode = current($transport); //$mode = ‘bike‘;
$mode =
prev($transport); // $mode =‘foot‘;
$mode = end($transport); // $mode
=‘plane‘;
$mode = current($transport); //$mode = ‘plane‘;
?>
2.next
<?php
$transport = array(‘foot‘, ‘bike‘, ‘car‘, ‘plane‘);
$mode =
current($transport); //$mode = ‘foot‘;
$mode = next($transport); // $mode
=‘bike‘;
$mode = next($transport); // $mode =‘car‘;
$mode =
prev($transport); // $mode =‘bike‘;
$mode = end($transport); // $mode
=‘plane‘;
?>
标签:
原文地址:http://www.cnblogs.com/zgaspnet/p/4313338.html