#39255 [Opn->Bgs]: foreach only shows last item
| From: | tony2001@php.net | Date: | Thu, 26 Oct 2006 16:57:28 +0000 |
| Subject: | #39255 [Opn->Bgs]: foreach only shows last item | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-104016@lists.php.net to get a copy of this message | ||
ID: 39255
Updated by: tony2001@php.net
Reported By: PK at KoffieHosting dot com
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: ISS 6.0
PHP Version: 5.1.6
New Comment:
Good catch, thanks.
Previous Comments:
------------------------------------------------------------------------
[2006-10-26 16:28:33] phpbugs at thequod dot de
Remove the ";" at the end of the foreach() line.
You have a foreach loop that does nothing and then the
echo uses the last elements.
This should work:
foreach ($_POST['Boxes'] as $Key => $Value)
{
echo '['.$Key.'] => '.$Value;
}
------------------------------------------------------------------------
[2006-10-25 15:04:25] PK at KoffieHosting dot com
I don't have enough rights on that machine (as it is not hosted with
us) to try that.
------------------------------------------------------------------------
[2006-10-25 15:02:00] tony2001@php.net
No need to upgrade the server, just put it in some other directory and
try it.
------------------------------------------------------------------------
[2006-10-25 14:53:06] PK at KoffieHosting dot com
Unfortunately I can not upgrade that server.
------------------------------------------------------------------------
[2006-10-25 14:49:49] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/39255
--
Edit this bug report at http://bugs.php.net/?id=39255&edit=1