Safe to delete elements of array in foreach

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Is it safe to remove elements from an array that foreach is working on?
(normally this is not the case but not sure in php) If so is there an
efficient way to handle it? (I could add the indexes to a temp array and
delete afterwards if necessary but since I'm actually working in a nested
situation this could get a little messy. I guess I could set there values to

K. Kothandaraman

Re: Safe to delete elements of array in foreach

On May 29, 9:37 pm, "kamal kothandaraman"
Quoted text here. Click to load it

There was a very long thread about this not too long ago:


Site Timeline