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 ~