无涯教程-PHP - next()函数

52 阅读1分钟

next() - 语法

next ( $array );

next()函数返回内部数组指针指向的下一个位置的数组值,如果没有更多元素,则返回False。

Sr.No Parameter & Description
1

array(必需)

它指定一个数组

next() - 返回值

它返回数组中的下一个元素。

next() - 示例

<?php
   $input=array(foot, bike, car, plane);
   $mode=current($input); 
   print "$mode <br />";
   
   $mode=next($input);
   print "$mode <br />";
   
?> 

这将产生以下输出-

foot
bike

参考链接

www.learnfk.com/php/php-fun…