PHP - next() 函式



語法

next ( $array );

定義和用法

next() 函式返回內部陣列指標指向的下一個陣列值,如果沒有更多元素則返回 FALSE。

引數

序號 引數及描述
1

array (必需)

指定一個數組

返回值

返回陣列中的下一個元素。

示例

試試以下示例:

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

這將產生以下結果:

foot
bike
php_function_reference.htm
廣告