characters

4 minutes read
How can I find non-ASCII characters in MySQL?   Query to find data as  “ASCII”, SELECT * FROM tableName WHERE NOT columnToCheck REGEXP '[A-Za-z0-9]'; 1 SELECT * FROM tableName WHERE NOT columnToCheck REGEXP '[A-Za-z0-9]'; Query to find the “Non ASCII ” SELECT * FROM my_table WHERE NOT HEX(my_column) REGEXP '^([0-7][0-9A-F])*$' 1 ...
2 minutes read
If you want to strip line feeds, carriage returns, and tabs you can use: $string = preg_replace('/[\x00-\x1F\x80-\x9F]/u', '', $string); 1 $string = preg_replace('/[\x00-\x1F\x80-\x9F]/u', '', $string);   =>Note that you must use single quotes for the above two examples. If you want to strip everything except basic printable ASCII characters (all the example characters above will be s...