How do I detect non-ASCII characters in a string? June 10, 2023 by Tarik I found it more useful to detect if any character falls out of the list if(preg_match('/[^\x20-\x7e]/', $string))