©
Ce document utilise Manuel du site Web PHP chinois Libérer
(PHP 5 >= 5.0.0)
ArrayIterator::seek — Seek to position
$position
)本函数还未编写文档,仅有参数列表。
position
The position to seek to.
没有返回值。
[#1] jon at ngsthings dot com [2008-10-21 17:08:20]
<?php
// didn't see any code demos...here's one from an app I'm working on
$array = array('1' => 'one',
'2' => 'two',
'3' => 'three');
$arrayobject = new ArrayObject($array);
$iterator = $arrayobject->getIterator();
if($iterator->valid()){
$iterator->seek(1); // expected: two, output: two
echo $iterator->current(); // two
}
?>