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

search for in the

ArrayObject> <ArrayIterator
Last updated: Fri, 20 Jun 2008

view this page in

ArrayIterator::valid

(PHP 5)

ArrayIterator::valid — Vérifie si un tableau contient d'autres entrées

Description

bool ArrayIterator::valid ( void )

Vérifie si un tableau contient d'autres entrées.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Aucune valeur n'est retournée.

Exemples

Exemple #1 Exemple avec ArrayIterator::valid()

<?php
$array 
= array('1' => 'one');

$arrayobject = new ArrayObject($array);
$iterator $arrayobject->getIterator();

var_dump($iterator->valid()); //bool(true)

$iterator->next(); // avance au prochain élément

//bool(false) car il n'y a qu'un seul élément dans le tableau
var_dump($iterator->valid());
?>



add a note add a note User Contributed Notes
ArrayIterator::valid
There are no user contributed notes for this page.

ArrayObject> <ArrayIterator
Last updated: Fri, 20 Jun 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites