note 55898 deleted from function.reset by mazzanet
| From: | mazzanet@php.net | Date: | Wed, 17 Aug 2005 07:54:23 +0000 |
| Subject: | note 55898 deleted from function.reset by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-93778@lists.php.net to get a copy of this message | ||
Note Submitter: giz at gbdesign dot net
----
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 ) );
?>