php - How to transform this Regex -
i'm trying figure out does, , how change it.
preg_replace('/[^\w\s]/','',$var); i think replaces symbols nothing (deletes them basically). if want allow specific symbols, change here?
for example want replace except:
- /
- numbers
- letters
- spaces
thanks.
^ means this, replaces word characters (\w) , whitespace (\s).
to replace except characters mention, use this:
preg_replace('/[^\w\s\/]/', '', $var); \/ escaped version of /.
Comments
Post a Comment