All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
PHP判断数字,汉字和英文_php资料_编程技术

Writer: delv Article type: Programming skills(编程技巧) Time: 2013/12/29 4:41:18 Browse times: 324 Comment times: 0

PHP判断数字,汉字和英文_php资料_编程技术


Head photo

Go homepage
Upload pictures
Write articles

PHP判断数字,汉字和英文_php资料_编程技术-你的首页-uuhomepage.com

function checkStr($str){
$output='';
$a=ereg('['.chr(0xa1).'-'.chr(0xff).']', $str);
$b=ereg('[0-9]', $str);
$c=ereg('[a-zA-Z]', $str);
if($a && $b && $c){ $output='汉字数字英文的混合字符串';}
elseif($a && $b && !$c){ $output='汉字数字的混合字符串';}
elseif($a && !$b && $c){ $output='汉字英文的混合字符串';}
elseif(!$a && $b && $c){ $output='数字英文的混合字符串';}
elseif($a && !$b && !$c){ $output='纯汉字';}
elseif(!$a && $b && !$c){ $output='纯数字';}
elseif(!$a && !$b && $c){ $output='纯英文';}
return $output;
}

echo checkStr('5爱u');
?>






There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.