//gb2312的话preg_match_all("/[".chr(0xa1)."-".chr(0xff)."]+/", $str, $chinese);echo implode("", $chinese[0]); //utf-8的话preg_match_all("/[\x{4e00}-\x{9fa5}]+/u", $str, $chinese);
时间: 2024-09-25 09:35:11
//gb2312的话preg_match_all("/[".chr(0xa1)."-".chr(0xff)."]+/", $str, $chinese);echo implode("", $chinese[0]); //utf-8的话preg_match_all("/[\x{4e00}-\x{9fa5}]+/u", $str, $chinese);