I have been using the pattern ~\W+~ to remove all alphanumerics from a given string, as in:
$arg = preg_replace('~\W+~', '', $arg);
I would like to amend this so that it could be used to validate a couple of inputs that will accept arbitrary database username and password credentials.
Is there an elegant pattern that will allow the various special characters that might appear in a database username/password combo?
Thanks!
Cranjled






Bookmarks