Hi,
I think that the fact that foreach doesn't reset an array when it is passed as a global should be clearly stated in the documentation. I've wasted a lot of time before I've realized it! There is also a user contributed note commenting this fact in the foreach page.
However, I wonder why it is so. A variable defined outside a function becomes a global, so... why foreach
resets globals when used outside a function and it doesn't when used inside?
(nervertheless, I love PHP ;-) )
Regards,
-- Llorenç Solé Maresme Netcom, S.L. tel +34 93 741 10 47 fax +34 93 741 10 48 email [EMAIL PROTECTED]