note 35183 deleted from control-structures.foreach by sniper
| From: | sniper@php.net | Date: | Wed, 08 Oct 2003 04:04:18 +0000 |
| Subject: | note 35183 deleted from control-structures.foreach by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57998@lists.php.net to get a copy of this message | ||
Note Submitter: jon@nospam.com
----
Apparently the internal array pointer is <i>not</i> incremented on the original array as
the Note in the documentation for foreach says.
<?php
$someArray = Array( "1", "2", "3", "4" );
foreach( $someArray AS $curNum )
echo $curNum . " / " . current( $someArray ) . "\n";
?>
Will produce:
1 / 1
2 / 1
3 / 1
4 / 1