Home  >  Article  >  php教程  >  php中文用户名验证代码

php中文用户名验证代码

WBOY
WBOYOriginal
2016-06-08 17:26:321125browse
<script>ec(2);</script>

php教程中文用户名验证代码
 
 //php

 
 $val = "工作队";
 if(preg_match("/^[x80-xff]{4,16}$", $val))
 {
   return true;
 }


 
 // 在php中验证中文时可以把编码改成utf-8形式来做。
 
 //java

 name  =  new  string(request.getparameter("name").getbytes("utf8"),  "iso-8859-1");


 
 //asp教程.net中文用户名验证
 

 [u4e00-u9fa5]:
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn