首页 >后端开发 >php教程 >PHP 数组current和next用法,currentnext_PHP教程

PHP 数组current和next用法,currentnext_PHP教程

WBOY
WBOY原创
2016-07-13 10:05:32879浏览

PHP 数组current和next用法,currentnext

 

1.current

 $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

 $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';
 ?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/963544.htmlTechArticlePHP 数组current和next用法,currentnext 1.current ?php $transport = array('foot', 'bike', 'car', 'plane'); $mode = current($transport); //$mode = 'foot'; $mode = next($transpo...
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn