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

search for in the

SimpleXMLIterator::getChildren> <SimpleXMLIterator
[edit] Last updated: Thu, 23 May 2013

view this page in

SimpleXMLIterator::current

(PHP 5 >= 5.1.0)

SimpleXMLIterator::currentRetourne l'entrée courante

Description

public 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"
}

Voir aussi



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

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