Posted in Javascript onMarch 05, 2015
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'; ?>
示例很简单,但是却很实用,希望小伙伴们能够喜欢。
PHP 数组current和next用法分享
- Author -
hebedich声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@