Cleaning up your inputs from $_POST, $GET and $_REQUEST is an important task if you’re looking at security of your PHP applications.
Handling Missing Data in Inputs
Missing data can be very annoying to a programmer. In fact, it is so annoying that very often we’ll write separate programs to clean up data and eliminate unpleasant conditions so that the main program doesn’t have to deal with it. Here, I’ll show some examples of the kind of problems we see.