- /**
- * Check detection class
- */
- Class Check{
- /**
- * IsUsername function: Check whether it matches the username format
- * $Argv is the username parameter to be tested
- * $RegExp is the regular statement to be tested
- * Return value: Return the username if it conforms to the username format, not false
- */
- ’ s ’ s ’ s ’ s ’ s ’ t And the length is 3-16 characters directly /* *
- * IsMail function: Check whether it is the correct email format
- * Return value: Return the email in the correct email format, not return false
- */
- function IsMail($Argv){
- $RegExp=/^[a-z0-9][a-z.0-9-_] @[a- z0-9_-] (?:.[a-z]{0,3}.[a-z]{0,2}|.[a-z]{0,3}|.[a-z]{0,2})$/i ;
- 🎝>*/< U>
Function issame ($ argvone, $ argvtwo, $ force = false) {-
Return $ FORCE? $ Argvone === $ argvone == $ argvtwo; -
} gExp=/^[1-9 | >- ; {9}$ /; /**
- * IsSmae function: Check whether the parameter values are the same
- * Return value: true if the same, false if not the same
- */
- at ’ s ;
-
-
- /**
- * IsNickname function: Check whether the parameter value is the correct nickname format (Beta)
- * Return value: If it is the correct nickname format, return the nickname format, if not, return false
- */
- function IsNickname($Argv){
- $RegExp=/^s*$|^c:concon$|[%,*"s <>&()]|xA1xA1|xACxA3|^Guest|^xD3xCExBFxCD|xB9x43xABxC8/is; //Copy From DZ
- return preg_match($RegExp,$Argv)?$Argv:false;
- }
-
- /**
- * IsChinese function: Check whether the parameter is Chinese
- * Return value: It is the return parameter, not false
- */
- function IsChinese($Argv,$Encoding=utf8){
- $RegExp = $Encoding==utf8?/^[x{4e00}-x{9fa5}] $/u:/^([x80-xFF][x80-xFF]) $/;
- Return preg_match($RegExp,$Argv)?$Argv:False;
- }
- }
- ?>
http://www.bkjia.com/PHPjc/486137.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/486137.htmlTechArticle?php /*** Check detection class*/ Class Check{ /** * IsUsername函数:检测是否符合用户名格式 * $Argv是要检测的用户名参数 * $RegExp是要进行检测的正则语句...