$clean = array();
$email_pattern = '/^[^@\s<&>]+@([-a-z0-9]+\.)+[a-z]{2,}$/i';
if (preg_match($email_pattern, $_POST['email']))
{
$clean['email'] = $_POST['email'];
}
The example code above (Source) uses an array called $clean to store the filtered value from $_POST. It's considered a security good practice. What are the advantages of using such an approach?
