<div class="codetitle"> <span><a style="CURSOR: pointer" data="40566" class="copybut" id="copybut40566" onclick="doCopy('code40566')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code40566"> <br><?php <BR>echo $str = "43fdf测试fdsfadaf43543543职工问防盗锁防盗锁5345gfdgd";<br>preg_match_all("/[0-9]{1}/",$str,$arrNum);<br>preg_match_all("/[a-zA-Z]{1}/",$str,$arrAl);<br>preg_match_all("/([/x{4e00}-/x{9fa5}]){1}/u",$str,$arrCh);<br>echo "<pre>";<br>echo "数字个数:".count($arrNum[0])."<br>";<br>echo "字母个数:".count($arrAl[0])."<br>";<br>echo "中文个数:".count($arrCh[0]);<br>?><br></pre> </div>