Php-function-next

提供:Dev Guides
移動先:案内検索

PHP-関数next()

構文

next ( $array );

定義と使い方

next()関数は、内部配列ポインターが指す次の場所の配列値を返します。要素がもうない場合はFALSEを返します。

パラメーター

Sr.No Parameter & Description
1

array(Required)

配列を指定します

戻り値

配列内の次の要素を返します。

次の例を試してください-

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

   $mode = next($input);
   print "$mode <br/>";

?>

これは、次の結果を生成します-

foot
bike