Home > php教程 > PHP源码 > body text

php中文用户名验证代码

WBOY
Release: 2016-06-08 17:26:32
Original
1121 people have browsed it
<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]:
Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!