|
[Font = Arial]
[Font = Arial]/**
* Calculate the Constellation Based on the month and date of the birthday.
*
* @ Param int $ birth_month
* @ Param int $ birth_date
* @ Return string
*/
Function get_constellation ($ birth_month, $ birth_date)
{
// When judging, in order to avoid doubts such as "1" and "true", or whether the judgment statement is always true, it is processed as a string.
$ Birth_month = strval ($ birth_month );
$ Constellation_name = array (
'Aquarius ', 'pisces', 'aries ', 'taurus', 'gemine', 'cancer ',
'Leo ', 'virgo', 'libra ', 'scorpio)', 'sagittarius ', 'capricorn'
);
If ($ birth_date <= 22)
{
If ('1 '! = $ Birth_month)
{
$ Constellation = $ constellation_name [$ birth_month-2];
}
Else
{
$ Constellation = $ constellation_name [11];
}
}
Else
{
$ Constellation = $ constellation_name [$ birth_month-1];
}
Return $ constellation;
} [/Font]
[Font = Arial]/**
* Calculate the Chinese zodiac Based on the Year in the birthday.
*
* @ Param int $ birth_year
* @ Return string
*/
Function get_animal ($ birth_year)
{
// The Year 1900 is the year of the mouse
$ Animal = array (
'Zombies ', 'Ugly niu', 'tigers', 'rabbits, 'chen long', 'snakes ',
'Afternoon m', 'goat ', 'Monkey Shen', 'youzichen ', 'pig', 'pig pig'
);
$ My_animal = ($ birth_year-1900) % 12;
Return $ animal [$ my_animal];
} [/Font] |