note 55898 added to function.reset

From: Date: Tue, 16 Aug 2005 21:41:14 +0000
Subject: note 55898 added to function.reset
Groups: php.notes 
Request: Send a blank email to php-notes+get-93767@lists.php.net to get a copy of this message
I like to do the following because I feel that is fit with the ADT for next, prev, end. I always code for first( $array); even though it does not exist.. [note return not needed in PHP5] as you can tell I am a c coder. <?php function first( $array ) { reset( $array ); return $array; } $array = range( "a", "d"); print_r( $array); print current( $array ); next( $array ); print current( $array ); print current( first( $array ) ); ?> ---- Manual Page -- http://www.php.net/manual/en/function.reset.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55898 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55898&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55898&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55898&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55898&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55898&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55898&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55898&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#93767) next »