According to the ID number coding rules to verify its validity, the specific implementation of the following, you can refer to the following The following is based on the ID card number coding rules, use JS to validate the code nbsp; nbsp; Idcard-validate.js code as follows:nbsp; nbsp; code:/**nbsp; *
This article mainly for you to share the two paragraph PHP verification ID card number is the correct function, interested in small partners can refer to
ID Card Verification The simplest is the length of the judgment, of course, this is very simple to break if you want mor
[17] = ValideCode [valCodePosition]) {Return true;} Else {Return false;}}/*** Identify a male or female by ID card* @ Param idCard: 15/18-digit ID card number* @ Return 'female '-female, 'male'-male*/Function maleOrFemalByIdCard (idCard ){IdCard = trim (idCard. replace (// g, ""); // process the ID card number. Contains spaces between characters.If (idCard. leng
Using php to verify the ID card function is very authoritative. it is very useful to verify the ID card in personal information. using php to verify the
Recent projects with the need to call the real-name authentication interface, real-name authentication interface price is not a few cents higher than the text message, so call the real-names authentication conditions to strictly check, so the use of JS to verify the real title and JS Authentication ID number.Go to the ChaseJS to
Provides various official and user-released code examples. For code reference, you are welcome to learn how to verify that the ID card number entered by the user is valid?
Most of the verification methods on the Internet only perform a simple verification of the ID card number format, and do not
How does jQuery use regular expressions to verify mobile phone numbers, ID card numbers, Chinese names, and jquery regular expressions?
Digit Determination Method: isNaN () function
The test () method is used to determine whether the regular expression content is matched in the string. the return value
Just look at the code, it's a simple PHP class
Copy Code code as follows:
$IDCard = new Idcard ();
Var_dump ($IDCard:: Iscard ($_get[' card '));
/**
* ID card processing class
*/
class Idcard {
//Check ID card is correct
public static function Iscard ($card) {
$card = Self::to18card ($card);
if (strlen ($card)!= 18) {
Digital Judgment Method: isNaN () function
The test () method determines whether the string matches the contents of the regular expression, and returns a Boolean value (True/false)
Verify that the Chinese name
function ischinaname (name)
{var pattern =/^[\u4e00-\u9fa5]{1,6}$/;
return pattern.test (name);
//Verify the mobile number
function Isphoneno (phone) {
var pattern =/^1[34578]\d{9}$/;
ret
structure of the ID card number
Identity card number is a feature combination code, consisting of 17-bit digital body code and a check code.
Order from left to right according to this: six-digit address code, eight-digit birth date code, three-bit digital sequence code and a digit check code .
Address code (first six digits)
The Code of administrative divisions in the county (city, Flag, district) of the p
{Verify the validity of the ID card number. If the returned value is null, it indicates normal. Otherwise, it indicates an error message}
{Author: Moon night kite, edocu@163.com}
Function validatepid (const apid: string): string;
{Internal function, which is the last digit of the I
In the user registration page Some requirements are more stringent, the need to verify the identity card is legitimate, through this function strictly this system software, thus filtering to many water passengers. Here's how to achieve this method for you to explain.
Most of the time we are using a set of regular expressions to determine whether the user entered the identity card
Function used to verify the validity of the ID card.
Function is_idcard ($ id) {$ id = strtoupper ($ id); $ regx = "/(^ \ d {15} $) | (^ \ d {17} ([0-9] | X) $)/"; $ arr_split = array (); if (! Preg_match ($ regx, $ id) {return FA
Php does not need regular expressions to verify true and false ID cards. Let's look at the code directly. a simple PHP class copies the code as follows :? Php $ IDCardnewIDCard (); var_dump ($ IDCard: isCard ($ _ GET [card]); you can directly view the code for the *** ID card processing class ** classIDC, A simple PHP class
The code
This article mainly introduces the PHP implementation can accurately verify the identity card number of the tool class, involving PHP for string interception, calculation, judgment and other related operational skills, and accompanied by a description of the principle of the ID number, the need for friends can refer to the next
The example in this paper describes the tool class that PHP implements to accur
When you enter your ID number, you may make an error accidentally. Let's talk about how to use the ET format conversion function to verify the birth date part of the ID number.
Figure 1
As shown in Figure 1, a is listed as an identity card number (the format of the column cell
Http://www.cnblogs.com/wuhuisheng/archive/2011/03/23/1992652.html
The main code for phone number verification is as follows:
Public bool istelephone (string str_telephone)
{
Return System. Text. regularexpressions. RegEx. ismatch (str_telephone, @ "^ (\ D {3, 4 }-)? \ D {6, 8} $ ");
}
The main code used to verify the mobile phone number is as follows:
Public boo
In the project, we are validating the user's input, the simplest way is to use regular expression, iOS system also provides a very convenient way, so that we can easily verify the user name, password, id good, mobile phone number, etc.Here is a validation method for the regular expression I used in my project,Due to th
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.