★ wanayoo — archive 1999 http://www.php.net/manual/fr/function.reset.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Tableaux
Quick Reference
English version of this pageGerman version of this pageJapanese version of this pageItalian version of this pageHungarian version of this page
Tableaux
* array
* array_count_values
* array_flip
* array_keys
* array_merge
* array_pad
* array_pop
* array_push
* array_reverse
* array_shift
* array_slice
* array_splice
* array_unshift
* array_values
* array_walk
* arsort
* asort
* compact
* count
* current
* each
* end
* extract
* in_array
* key
* krsort
* ksort
* list
* next
* pos
* prev
* range
* reset
* rsort
* shuffle
* sizeof
* sort
* uasort
* uksort
* usort
Manual: reset
View the source code for this pageSearch the site



Previous page
 range
 Updated
Sun, 06 Aug 2000
rsort 
Next page


reset

(PHP3 , PHP4 )

reset --  Remet le pointeur interne de tableau au début

Description

mixed reset (array array)

reset() replace le pointeur de tableau array au premier élément.

reset() retourne la valeur du premier élément.

Voir aussi: current(), each(), next(), prev(), et reset().


User Contributed Notes: reset


kk@shonline.de
30-Jul-1998 05:22
When used on a scalar or unset value, reset() spews warning messages. This is often a problem when accessing arrays generated from HTML form input data: these are scalar or unset if the user didn't enter sufficient information.

You can silence these error messages by prefixing an @ (at sign) to reset(), but it is better style to protect your reset() and the following array traversal with an if (isset()). Example code:

if (isset($form_array)) {
reset($form_array);
while (list($k, $v) = each($form_array) {
do_something($k, $v);
}
}



 About Notes


Previous page
 range
 Updated
Sun, 06 Aug 2000
rsort 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.