How do I replace all characters except: 1. Letters/Numbers 2. Underscores 3. Periods 4. @
Thanks for the help!
You don't say what you want to replace them with, so for this example I'll replace them with an underscore:
$newString = preg_replace('/[^a-z0-9_.@]/i', '_', $oldString);