Re: PHP 4.0 Bug #5525: double foreach-output within multiple arrays

From: Date: Tue, 11 Jul 2000 18:26:44 +0000
Subject: Re: PHP 4.0 Bug #5525: double foreach-output within multiple arrays
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-24214@lists.php.net to get a copy of this message
<kaspro@hellige.de> wrote... > I may give you a short script... > > foreach($arr as $Row){ > print "<tr>"; > foreach($Row as $Value) print "<td>$Value</td>"; > print "</tr>"; > } > > The output of $Row works fine, but: > $Value comes like the following: > > Value1 Value1 Value2 Value2 Value3 Value3 .....and so on. Are you sure that this is not correctly reporting the contents of $Row. For example, if the rows originally came from a database query you may find that each value is there twice, once with a numeric key and once with a key named after the column. Try var_dump($Row) or print_r($Row) to see what is in there.

« previous php.dev (#24214) next »