search
HomePHP LibrariesOther librariesID card verification PHP class
ID card verification PHP class

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

class IdcardAction extends Action{

  function get_xingzuo($cid) { 

    if (!$this->isIdCard($cid)) return '';

    $bir = substr($cid,10,4);

    $month = (int)substr($bir,0,2);

    $day = (int)substr($bir,2);

    $strValue = '';

    if (($month == 1 && $day >= 20) || ($month == 2 && $day <= 18)) {

      $strValue = "水瓶座";

    else if (($month == 2 && $day >= 19) || ($month == 3 && $day <= 20)) {

      $strValue = "双鱼座";

    else if (($month == 3 && $day > 20) || ($month == 4 && $day <= 19)) {

      $strValue = "白羊座";

    else if (($month == 4 && $day >= 20) || ($month == 5 && $day <= 20)) {

      $strValue = "金牛座";

    else if (($month == 5 && $day >= 21) || ($month == 6 && $day <= 21)) {

      $strValue = "双子座";

    else if (($month == 6 && $day > 21) || ($month == 7 && $day <= 22)) {

      $strValue = "巨蟹座";

    else if (($month == 7 && $day > 22) || ($month == 8 && $day <= 22)) {

      $strValue = "狮子座";

    else if (($month == 8 && $day >= 23) || ($month == 9 && $day <= 22)) {

      $strValue = "处女座";

    else if (($month == 9 && $day >= 23) || ($month == 10 && $day <= 23)) {

      $strValue = "天秤座";

    else if (($month == 10 && $day > 23) || ($month == 11 && $day <= 22)) {

      $strValue = "天蝎座";

    else if (($month == 11 && $day > 22) || ($month == 12 && $day <= 21)) {

      $strValue = "射手座";

    else if (($month == 12 && $day > 21) || ($month == 1 && $day <= 19)) {

      $strValue = "魔羯座";

    }

    return $strValue;

  }

PHP automatically obtains the corresponding constellation function based on the ID number, and then automatically returns the corresponding constellation, automatically returns the gender, and determines whether it is an adult

Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

JavaScript ID card authenticity verification methodJavaScript ID card authenticity verification method

10Aug2017

PHP100 Chinese website is the first professional website in China that focuses on sharing PHP resources, and also provides a PHP Chinese communication community. For PHP learning researchers, it provides: the latest PHP information, original content, open source code, PHP video tutorials and other related content.

PHP professional ID card verification, no regular verification of ID card_PHP tutorialPHP professional ID card verification, no regular verification of ID card_PHP tutorial

13Jul2016

PHP professional ID card verification, no need to use regular ID verification. In the past, when I wanted to verify the ID card, we would mostly use regular expressions to determine whether the user input was a 15-digit or 18-digit full number, and then determine whether the ID card was legal. This method is only the most basic.

PHP ID card number checking class example, PHP ID card number example_PHP tutorialPHP ID card number checking class example, PHP ID card number example_PHP tutorial

13Jul2016

PHP ID card number checking class instance, PHP ID card number instance. PHP ID card number checking class example, PHP ID card number example This example describes the PHP ID card number checking class. Share it with everyone for your reference. The details are as follows: php class CIDMaker

PHP ID card verification code calculation method_php examplePHP ID card verification code calculation method_php example

17Aug2016

This article will share with you an attempt to use PHP language to implement the ID card verification code to determine whether the user's ID number is correct.

PHP implements universal credit card verification class, PHP universal credit card verification_PHP tutorialPHP implements universal credit card verification class, PHP universal credit card verification_PHP tutorial

13Jul2016

PHP implements universal credit card verification class, PHP universal credit card verification. PHP implements a universal credit card verification class, PHP universal credit card verification This example describes how PHP implements a universal credit card verification class. Share it with everyone for your reference. The original description is as follows:

Calculation of ID card verification codeCalculation of ID card verification code

25Jul2016

Calculation of ID card verification code

See all articles