PHP sample code for verifying the validity of Chinese citizen ID card numbers
This article uses Java to verify the ID card numbers of Chinese citizens (15 or 18 digits). The functions are as follows:
ID
program's work. and the template of the juice is only required to complete the front-end engineers, using HTML, CSS and JavaScript, such as the front page design language written. In addition, in the template file you need to use tags that the template engine can parse, and the dynamic data that is allocated in PHP is referenced in the
. Therefore, the PHP program only creates dynamic data, loads the template engine, and allocates dynamic data to the template to complete the work of the PHP program. However, the template design requires independent front-end engineers to use HTML, CSS, javascript, and other front-end page design languages. In addition, you also need to use the tags that can be
Package cyachina. util;
/*** Created by intellij idea.* User: Administrator* Date: 2004-8-13* Time: 15:37:28* To change this template use file | Settings | file templates.*/Public class idcardutil {
/**** @ Param century 19 for 19xx and 20 for 20xx* @ Param idcardno15 ID card number to be converted* @ Return*/Public static string from15to18 (INT century, string i
blank or invalid characters
6. Automatically rotate characters (if skewed) to recognize characters
If the image in the sample has adhesion, the partition may be inaccurate. In this case, it is difficult to rotate automatically.
Currently, characters can be separated. Next, we will study how to identify them. (If a single character is more standard, you can use the ready-made OCR Control)
Here are some examples.
Common Verification Code (no difficulty
the future)
5. Discard blank or invalid characters
6. Automatically rotate characters (if skewed) to recognize characters
If the image in the sample has adhesion, the partition may be inaccurate. In this case, it is difficult to rotate automatically.
Currently, characters can be separated. Next, we will study how to identify them. (If a single character is more standard, you can use the ready-made OCR Control)
Here are some examples.
Common Ver
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.