Strict verification of Identity card information, strict verification of identity card information
$a = ' 130424770827005 '; $reg = '/[1-9]\d{5} (((1[9|8) \d{2}) | ( 20[0-1]\d)) ((0\d) | ( 1[0-2]) (([0|1|2]\d) |3[0-1]) \d{3} ([0-9]| X)/'; $reg = '/[1-9]\d{7} ((0\d) | ( 1[0-2]) (([0|1|2]\d) |3[0-1]) \d{3}/'; the problem is judging the year from 1800 to 2019
Wait 4 years to change.
In fact, it can be more stringent. preg_match($reg,$a,$mm); Var_dump ($mm); output result Array (size=6) string ' 130424770827005 ' (length=15) string ' (length=2) string ' (length=2) string ' (length=0) string ' (length=2 ) string ' "(length=2)
http://www.bkjia.com/PHPjc/942281.html www.bkjia.com true http://www.bkjia.com/PHPjc/942281.html techarticle Strict verification of identity card information, strict verification of identity card information $a = ' 130424770827005 '; $reg = '/[1-9]\d{5} (((1[9|8) \d{2}) | ( 20[0-1]\d)) ((0\d) | ( 1[0-2]) (([0|1|2]\d) |3[0-1]) \d{3} ...