PHP 数组current和next用法,currentnext_PHP教程
程序员文章站
2024-02-13 23:54:58
...
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';
?>
推荐阅读
-
php中使用key,value,current,next和prev函数遍历数组的方法
-
php中使用key,value,current,next和prev函数遍历数组的方法
-
PHP中key和current,next的联合运用实例分析,next实例分析_PHP教程
-
PHP中key和current,next的联合运用实例分析,next实例分析_PHP教程
-
php中current、next与reset函数用法实例,currentreset_PHP教程
-
PHP 数组current和next用法,currentnext_PHP教程
-
PHP 数组函数current和next用法分享
-
PHP 数组current和next用法,currentnext
-
PHP 数组current和next用法,currentnext
-
php中使用key,value,current,next和prev函数遍历数组的方法_PHP