Blogger Information
Blog 250
fans 3
comment 0
visits 321762
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
正则表达式sfz号
梁凯达的博客
Original
1033 people have browsed it

//***号
 //\d匹配1-9数字
 //^用于开头
 //$定义结尾
 $preg = '/^[1-8]\d{5}(1\d\d\d|200\d|201[0-8])(0-[1-9]|1[0-2])(0[1-9]|1\d|2\d|31|30)\d{3}(\d|x)$/';
 $str = '310110200104038891';
 preg_match($preg,$str,$arr);
 var_dump($arr);

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post