$str = \"This is a string containing 中文 characters. Some more characters - 中华人民共和国 \";
How do I detect chinese characters from this string and prin
I've solved this problem using preg_match and regular expressions:
$str = "This is a string containing 中文 characters. Some more characters - 中华人民共和国 "; preg_match(/[\x{4e00}-\x{9fa5}]+.*\-/u, $str, $matches);