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