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

search for in the

Fonctions SimpleXML> <SimpleXMLIterator::rewind
[edit] Last updated: Thu, 23 May 2013

view this page in

SimpleXMLIterator::valid

(PHP 5 >= 5.1.0)

SimpleXMLIterator::validVérifie si une ressource SimpleXML contient d'autres entrées

Description

bool SimpleXMLIterator::valid ( void )

Cette méthode vérifie si l'élément courant est valide, après un appel à SimpleXMLIterator::rewind() ou SimpleXMLIterator::next().

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Retourne TRUE si l'élément courant est valide, FALSE sinon.

Exemples

Exemple #1 Vérifie si un élément est valide

<?php
$xmlIterator 
= new SimpleXMLIterator('<books><book>SQL Basics</book></books>');

$xmlIterator->rewind(); // Retour au premier élément
echo var_dump($xmlIterator->valid()); // bool(true)

$xmlIterator->next(); // advance to the next element
echo var_dump($xmlIterator->valid()); // bool(false) car il y a un seul élément
?>



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

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