- <?php
- $action = trim($_get['action']);
- if($action == "sub")
- {
- $str = $_post['dir'];
- //if(!preg_match("/^[".chr(0xa1)."-".chr(0xff)."a-za-z0-9_]+$/",$str)) //gb2312漢字字母數(shù)字下劃線正則表達(dá)式
- if(!preg_match("/^[x{4e00}-x{9fa5}a-za-z0-9_]+$/u",$str)) //utf-8漢字字母數(shù)字下劃線正則表達(dá)式
- {
- echo "<font color=red>您輸入的[".$str."]含有違法字符</font>";
- }
- else
- {
- echo "<font color=green>您輸入的[".$str."]完全合法,通過!</font>";
- }
- }
- ?>
新聞熱點(diǎn)
疑難解答