Remove Chinese Characters with Preg_replace?
php
Solution
In UTF-8 mode, "\x{...}" is allowed, where the contents of the braces is a string of hexadecimal digits.
You don't appear to be in UTF-8 mode. To enable this mode, add the `u` modifier to the end of the regex.
Problem
I am trying to remove chinese characters from string. Tried this but can't get this working. It says: Warning: preg_replace() [function.preg-replace]: Compilation failed: character value in \x{...} sequence is too large at offset 9 in ``` preg_replace('/[^\x{4e00}-\x{9fa5}]+/', '', $string) ``` How can I get this working ?