preg_match_all('/(?:([a-z]+)|.)/i', $_POST['username'], $matches); $_POST['username'] = implode('', $matches);
To strip EVERYTHING that is not alpha numeric from all of the registration inputs and it works exactly how I want it to, however, this also strips the @ sign and periods, which is bad for e-mails.
Is there any way to have it do what it does now except add '@' and '.' to the safe list? This way only alphanumeric characters and those two symbols will remain.