<?php //提取字符串中的漢字其余信息剔除 $str='f龍,真 。,.,。?!:;·…~&@#,.?!:;、……~&@#“”‘’〝 "〞'´'><﹞﹝><》《】【)(()[]«»‹〔›〕〈〉』『〗〖}{」「][}{︵︷︹︽︿﹁﹃︗︗/|\\|/︘︼﹄﹂︾﹀︺︸︶__﹏﹍``¡¦^¨ˊˇ¿ˋ︴﹊﹉﹋ ̄¯1234456789'; preg_match_all('/[\x{4e00}-\x{9fff}]+/u', $str, $matches);//只要漢字 preg_match_all('/[a-zA-Z0-9\x{4e00}-\x{9fff}]+/u', $str, $matches_1);//只保留漢字和數字和英文字符 $str = join('', $matches[0]); $str_1 = join('', $matches_1[0]); echo $str; echo $str_1; ?>