next()函數作用:
php中next()函數的作用是將數組中的內部指針向前移動一位。
next()函數語法:
next(array)
參數:
array:規定要使用的數組。
next()函數使用方法:
例:輸出數組中的當前元素和下一個元素的值<?php$people = array("Bill", "Steve", "Mark", "David");echo current($people) . "<br>";echo next($people);?>
<?php
$people = array("Bill", "Steve", "Mark", "David");
echo current($people) . "<br>";
echo next($people);
?>