RE: [PHP] flaking out on foreach
| From: | Matt Schroebel | Date: | Tue, 27 Aug 2002 15:11:32 +0000 |
| Subject: | RE: [PHP] flaking out on foreach | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114261@lists.php.net to get a copy of this message | ||
> From: ROBERT MCPEAK [mailto:RMCPEAK@jhuccp.org]
> Sent: Tuesday, August 27, 2002 11:08 AM
> Subject: [PHP] flaking out on foreach
>
>
> Why is this code:
>
> <?php
>
> $bob=array(1,2,3,5,6);
>
> foreach($bob as $foo);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Because of the empty statement caused by the mistaken semi-colon here
> {
> echo "$foo<BR>";
> }
> ?>
>
> Rendering only "6". That's it. Just "6". What am I missing here?
>