in reply to Re: how do foreach and while affect an array?
in thread how do foreach and while affect an array?
You can iterate through arrays using foreach and while w/o worrying about losing data.
Yes, foreach() ( aka for() ) does iterate through the array, and it does not affect the contents of the array on its own. But just to be clear, one doesn't iterate through arrays with while().
while() can indeed be utilized to run through an array, but whether that affects the contents of the array depends on the implementation. In the end, while() does not operate on arrays on its own in any fashion.
Zenon Zabinski | zdog | firstname.lastname@example.org