SplFixedArray::next

(PHP 5 >= 5.3.0, PHP 7)

SplFixedArray::nextMove to next entry

설명

public void SplFixedArray::next ( void )

Move the iterator to the next array entry.

인수

이 함수는 인수가 없습니다.

반환값

값을 반환하지 않습니다.

add a note add a note

User Contributed Notes 1 note

up
0
kishor10d at gmail dot com
1 year ago
<?php

/**
* Example : rewind();
*/

$arr = new SplFixedArray(5);

$a = $arr->key(); //Zero'th index
var_dump($a);
echo
"<br>";

$arr->next(); // Shift to first index
$a = $arr->key();
var_dump($a);
echo
"<br>";

$arr->next(); // Shift to second index
$a = $arr->key();
var_dump($a);
echo
"<br>";

$arr->next();  // Shift to third index
$a = $arr->key();
var_dump($a);
echo
"<br>";
?>

The above example will output:

int(0)
int(1)
int(2)
int(3)
To Top