Example of PHP implementation to validate ID information

Source: Internet
Author: User
PHP ID Verification related classes, PHP according to the ID number, automatically obtain the corresponding constellation function, according to the ID number, automatically return the corresponding constellation, according to the ID number, automatically return the corresponding zodiac, according to the ID number, automatically return sex, check whether it is a social security number, according to the serial number from the check code string to extract the corresponding characters.

The first step is to download the PHP ID validation related libraries that we need to use for this lesson: http://www.php.cn/xiazai/leiku/527

The second step, after the download, find the PHP class files we need, unzip to our local directory, create a new PHP file!

After the third step, we will call this class in the new PHP file, and instantiate the class:

<?phpinclude_once "shenf.php";//Introduce class file $obj = new Idcardaction; Instantiate//According to the ID number to judge, meet the requirements to return the corresponding information echo "automatically returns the corresponding constellation according to the ID number:". $obj->get_xingzuo ("440983198311220309"). <br> "echo" Automatically returns the corresponding zodiac sign according to the ID number: ". $obj->get_shengxiao (" 440983198311220309 ")." <br> "echo" Automatically returns the corresponding gender according to the ID number: ". $obj->get_xingbie (" 440983198311220309 ")." <br> "echo" determines whether adult according to the ID number: ". $obj->checkbig18 (" 440983198311220309 ")." <br> "echo" according to the ID number, determine whether it is a social Security number: ". $obj->isidcard (" 440983198311220309 ")." <br> ";? >

Run this file and get the results as shown:

Attention:

We're just a part of the class. As an example, more small partners can try it out for themselves ~

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.