天朝又开始发力了,所有国内能发文的地方必须做guanjianzi 过滤,包括藏文过滤
以下是根据当地相关法律法规编写的检测函数
/** * [isSpecialCharacter 校验阿拉伯文、藏文] * @param [type] $word [description] * 0600-06FF:阿拉伯文 (Arabic) * 0750-077F:阿拉伯文补充 (Arabic Supplement) * FB50-FDFF:阿拉伯表达形式A (Arabic Presentation Form-A) * FE70-FEFF:阿拉伯表达形式B (Arabic Presentation Form-B) * 0F00-0FFF:藏文 (Tibetan) * @return boolean [description] */ function isSpecialCharacter($word) { $badArr = array( // /([\x{4e00}-\x{9fa5}]+)/u "/([\x{0600}-\x{06FF}]+)/u", "/([\x{0750}-\x{077F}]+)/u", "/([\x{FB50}-\x{FDFF}]+)/u", "/([\x{FE70}-\x{FEFF}]+)/u", "/([\x{0F00}-\x{0FFF}]+)/u", ); foreach ($badArr as$v) { if (preg_match($v,$word)) { return true; } } return false; } // $word="ئۇ ىلى"; // $word="غۇ撒打算s的"; var_dump(isSpecialCharacter($word));