downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Exceptions> <SeekableIterator
[edit] Last updated: Fri, 17 May 2013

view this page in

SeekableIterator::seek

(PHP 5 >= 5.1.0)

SeekableIterator::seekRecherche une position

Description

abstract public void SeekableIterator::seek ( int $position )

Recherche la position donnée dans l'itérateur.

Liste de paramètres

position

La position à atteindre.

Valeurs de retour

Aucune valeur n'est retournée.

Erreurs / Exceptions

L'implémentations doit émettre une exception OutOfBoundsException si la position position n'est pas atteignable.

Exemples

Exemple #1 Exemple avec SeekableIterator::seek()

Déplace l'itérateur à la position 3 (ArrayIterator implémente SeekableIterator).

<?php
$array 
= array("apple""banana""cherry""damson""elderberry");
$iterator = new ArrayIterator($array);
$iterator->seek(3);
echo 
$iterator->current();
?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

damson



add a note add a note User Contributed Notes SeekableIterator::seek - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites