Reputation
226
Top tag
Next privilege 250 Rep.
View close votes
Badges
1 3
Newest
 Nice Answer
Impact
~5k people reached

  • 0 posts edited
  • 0 helpful flags
  • 0 votes cast
Dec
9
awarded  Nice Answer
Sep
9
awarded  Yearling
May
15
awarded  Teacher
May
14
comment Directly modifying superglobals
@Wesley, the primary reason it is "bad" is that it makes it much more likely that you'll forget to sanitize some user data. In your example, you modify one key then pass the entire array. What if some of that data contains malicious input that is not processed? It's much better to build that new array by hand, copying only the things you need from $_POST into it, sanitizing as you go along. And regarding other people doing this... well, a lot of people write very bad PHP code, but that's no excuse for you to as well. :)
May
13
answered Directly modifying superglobals
Sep
26
awarded  Autobiographer