Re: Alter an Array Key
| From: | Stut | Date: | Sat, 14 Jul 2007 13:09:11 +0000 |
| Subject: | Re: Alter an Array Key | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258857@lists.php.net to get a copy of this message | ||
Craige Leeder wrote:
1. Don't modify $_POSTWhy not?
2. You controll the name of the array keys with the form. Why is there any need to change them form PHP's side of things?That's an assumption. A reasonable one in most cases, but not necessarily the case.
3. I'm not sure Roberts solution would work. I think it might result in an endless loop, and timeout your script.I always worry about adding or removing elements while iterating through an array. I generally build up an array of keys to remove and remove them in a separate loop afterwards just to be on the safe side. -Stut -- http://stut.net/