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

search for in the

SimpleXMLIterator::getChildren> <SimpleXMLIterator
Last updated: Fri, 14 Aug 2009

view this page in

SimpleXMLIterator::current

(PHP 5 >= 5.1.0)

SimpleXMLIterator::currentRetourne l'entrée courante de SimpleXML

Description

mixed SimpleXMLIterator::current ( void )

Cette méthode retourne l'élément courant comme un objet SimpleXMLIterator ou bien NULL.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Retourne l'élément courant comme un objet SimpleXMLIterator ou NULL, en cas d'échec.

Exemples

Exemple #1 Retourne l'élément courant

<?php
$xmlIterator 
= new SimpleXMLIterator('<books><book>PHP basics</book><book>XML basics</book></books>');
var_dump($xmlIterator->current());

$xmlIterator->rewind(); // Retour au premier élément
var_dump($xmlIterator->current());
?>

L'exemple ci-dessus va afficher :

NULL
object(SimpleXMLIterator)#2 (1) {
  [0]=>
  string(10) "PHP basics"
}



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

SimpleXMLIterator::getChildren> <SimpleXMLIterator
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites