Date: 08/29/01
- Next message: alvarez <email protected>: "[PHP] Re: bugroff licensed tree converter"
- Previous message: Geoff Caplan: "[PHP] Re: The future of PHP - object model"
- In reply to: Brian White: "Re: [PHP] I beleive I have found a bug....."
- Next in thread: Frederick L. Steinkopf: "Re: [PHP] The future of PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
<Original message>
From: Brian White <bwhite <email protected>>
Date: Wed, Aug 29, 2001 at 06:16:49PM +1000
Message-ID: <4.3.2.20010829181433.00addf00 <email protected>>
Subject: Re: [PHP] I beleive I have found a bug.....
> You didn't read my code closely enough:
>
> I said:
> > > If I replace the problem line
> > > foreach ( array_keys($data) as $key2 )
> > > ^^^^^^^^^^
> > > with the alternate
> > > foreach ( $data as $key2=>$val2 )
</Original message>
<Reply>
Oops... Sorry! That's what I said... I didn't take a very good look.
But now I have... You need to reset the $data-array before the inner
foreach-loop. Then there's no problem.
--- PHP code ---
<?php
print "<pre>\n";
foreach ( $data as $key1=>$val1 )
{
reset ($data); // <----- R E S E T !!!
foreach ( array_keys($data) as $key2 )
{
if ( $key1 == $key2 )
print "<b>$key2</b>";
else
print $key2;
print " ";
}
print "\n";
}
print "</pre>";
?>
--- End of PHP code ---
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze <email protected> -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: alvarez <email protected>: "[PHP] Re: bugroff licensed tree converter"
- Previous message: Geoff Caplan: "[PHP] Re: The future of PHP - object model"
- In reply to: Brian White: "Re: [PHP] I beleive I have found a bug....."
- Next in thread: Frederick L. Steinkopf: "Re: [PHP] The future of PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

