Warning: file_put_contents(): Only -1 of 44 bytes written, possibly out of free disk space in /var/www/html/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 25
natsort pos Tableaux PHP Manual next (PHP 4, 5, PECL axis2:0.1.0-0.1.1 xmlreader:1.0-1.0.1) — Avance le pointeur interne d'un tableau Description mixed ( array &$array ) next() retourne l�...
Forum und email

next

(PHP 4, PHP 5, PECL axis2:0.1.0-0.1.1 xmlreader:1.0-1.0.1)

next — Avance le pointeur interne d'un tableau

Description

mixed next ( array &$array )

next() retourne l'élément suivant du tableau array ou FALSE s'il n'y a plus d'éléments.

next() se comporte comme current(), mais avec une différence : il avance le pointeur interne de tableau d'un élément avant de retourner la valeur qu'il pointe. Lorsque le pointeur dépasse le dernier élément, next() retourne FALSE.

Warning

Cette fonction peut retourner FALSE, mais elle peut aussi retourner une valeur équivalent à FALSE, utilisable dans une condition if simple. Utilisez l'opérateur === pour tester la valeur de retour exacte de cette fonction.

Note: Vous ne serez pas capable de distinguer la fin d'un tableau avec l'élément booléen FALSE. Pour traverser correctement un tableau qui peut contenir l'élément FALSE, voyez la fonction each().

Example#1 Exemple avec next() et ses amies

<?php
$transport 
= array('pied''velo''voiture''avion');
$mode current($transport); // $mode = 'pied';
$mode next($transport);    // $mode = 'velo';
$mode next($transport);    // $mode = 'voiture';
$mode prev($transport);    // $mode = 'velo';
$mode end($transport);     // $mode = 'avion';
?>

Voir aussi current(), end(), prev(), reset(), each().