You can filter it like:
$text = preg_replace("/[^a-zA-Z0-9]+/", "", $text);
As for some symbols, you should be more specific
More Related Contents:
- Turn Plain Text URLs into Active Links using PHP [closed]
- How to find value between commas
- How to validate an email address in PHP
- How to validate an Email in PHP?
- deny direct access to a folder and file by htaccess
- parse youtube video id using preg_match [duplicate]
- Convert plain text URLs into HTML hyperlinks in PHP
- Remove style attribute from HTML tags
- “vertical” regex matching in an ASCII “image”
- Regular expression pattern to match URL with or without http://www
- Match a^n b^n c^n (e.g. “aaabbbccc”) using regular expressions (PCRE)
- What Delimiter to use for preg_replace in PHP (replace working outside of PHP but not inside)
- Parsing CSS by regex
- Remove repeating character
- What is the use of ‘\G’ anchor in regex?
- PHP regular expression for strong password validation [duplicate]
- Change single variable value in querystring [closed]
- How to check, if a php string contains only english letters and digits?
- php regex to get string inside href tag
- Explode string by one or more spaces or tabs
- How to prefix a positive number with plus sign in PHP
- Regex / DOMDocument – match and replace text not in a link
- Converting Javascript Regex to PHP
- Extract floating point numbers from a delimited string in PHP
- Parse math operations with PHP
- How to validate phone number using PHP? [duplicate]
- What does [\S\s]* mean in regex in PHP?
- UTF-8 in PHP regular expressions [duplicate]
- Get non-numeric characters then number on each line of a block of texf
- Validate date format in php