当前位置:首页 > 百度

12生肖统计器 生肖统计app

本文向给大家分享12生肖统计器相关知识,同时小编也会对生肖统计app进行解释,如果能解决您在12生肖统计器方面面临的问题,请收藏关注本站,现在开始吧!

php 自动计算12生肖

属相计算器生肖查询软件
<?php
//2002/10/23-->出生年
/*
计算12个星座
计算12个生肖
计算年龄
*/
class timeage
{
public $y = 0;
public $m = 0;
public $d = 0;
public $age = 0;
public $time = 0;
public function __construct($time)
{
$this->time = $time;
$this->y = date('Y',$this->time);
$this->m = date('m',$this->time);
$this->d = date('d',$this->time);
}
public function getage()
{
$this->age = time() - $this->time;
$this->age = $this->age/60/60/24/365;
return (int)$this->age;
}
public function getconstellation()
{
switch ($this->m)
{
case 1:
if ($this->d < 19)
{
$this->constellation = '摩羯座';
return $this->constellation;
}
else
{
$this->constellation = '水瓶座';
return $this->constellation;
}
break;
case 2:
if ($this->d < 18)
{
$this->constellation = '水瓶座';
return $this->constellation;
}
else
{
$this->constellation = '双鱼座';
return $this->constellation;
}
break;
case 3:
if ($this->d < 20)
{
$this->constellation = '双鱼座';
return $this->constellation;
}
else
{
$this->constellation = '白羊座';
return $this->constellation;
}
break;
case 4:
if ($this->d < 19)
{
$this->constellation = '白羊座';
return $this->constellation;
}
else
{
$this->constellation = '金牛座';
return $this->constellation;
}
break;
case 5:
if ($this->d < 20)
{
$this->constellation = '金牛座';
return $this->constellation;
}
else
{
$this->constellation = '双子座';
return $this->constellation;
}
break;
case 6:
if ($this->d < 21)
{
$this->constellation = '双子座';
return $this->constellation;
}
else
{
$this->constellation = '巨蟹座';
return $this->constellation;
}
break;
case 7:
if ($this->d < 22)
{
$this->constellation = '巨蟹座';
return $this->constellation;
}
else
{
$this->constellation = '狮子座';
return $this->constellation;
}
break;
case 8:
if ($this->d < 22)
{
$this->constellation = '狮子座';
return $this->constellation;
}
else
{
$this->constellation = '处女座';
return $this->constellation;
}
break;
case 9:
if ($this->d < 22)
{
$this->constellation = '处女座';
return $this->constellation;
}
else
{
$this->constellation = '天秤座';
return $this->constellation;
}
break;
case 10:
if ($this->d < 23)
{
$this->constellation = '天秤座';
return $this->constellation;
}
else
{
$this->constellation = '天蝎座';
return $this->constellation;
}
break;
case 11:
if ($this->d < 22)
{
$this->constellation = '天蝎座';
return $this->constellation;
}
else
{
$this->constellation = '射手座';
return $this->constellation;
}
break;
case 12:
if ($this->d < 20)
{
$this->constellation = '射手座';
return $this->constellation;
}
else
{
$this->constellation = '摩羯座';
return $this->constellation;
}
break;
}
}
public function getzodiac()
{
$this->animals = array('鼠', '牛', '虎', '兔', '龙', '蛇','马', '羊', '猴', '鸡', '狗', '猪');
$this->zodiac = ($this->y - 1900) % 12;
return $this->animals[$this->zodiac];
}
}
$age = strtotime('1993-07-25');
echo $age;
$a = new timeage($age);
echo '<br>';
echo $a->y;
echo '<br>';
echo $a->m;
echo '<br>';
echo $a->d;
echo '<br>';
echo $a->time;
echo '<br>';
echo $a->age;
echo '<br>';
echo $a->getage();
echo '<br>';
echo $a->getconstellation();
echo '<br>';
echo $a->getzodiac();
//没事干替你写了个全部的功能函数 写代码类 记得给好评

以上就是与12生肖统计器以及生肖统计app的相关内容,也是关于php 自动计算12生肖的分享。看完12生肖统计器一文后,希望这对大家有所帮助!

1.《12生肖统计器 生肖统计app》援引自互联网,旨在传递更多网络信息知识,仅代表作者本人观点,与本网站无关,侵删请联系页脚下方联系方式。

2.《12生肖统计器 生肖统计app》仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证。

3.文章转载时请保留本站内容来源地址,https://www.qujk.net/baidu/1313.html

上一篇

判达十二星座2023年运势 未来三年十二星座运势

下一篇

江诗丹顿官方售后服务中心 爱彼售后服务维修

中国结婚年龄规定

中国结婚年龄规定

法定结婚年龄多少?我国《婚姻法》规定,结婚年龄,男不得早于22周岁,女不得早于20周岁。这是男女结婚年龄的起点,是划分合法婚姻和违法婚姻的界限。男女到了这个年龄

根深叶茂源远流长

根深叶茂源远流长

根深叶茂意思根深叶茂开放分类:成语、文学、词汇、国学、成语词典词目根深叶茂发音gēnshēnyèmào释义茂:繁茂。根扎得深,叶子就茂盛。比喻基础牢固,就会兴旺

龙神大陆罗刹海市传奇

龙神大陆罗刹海市传奇

本文向给大家分享龙神大陆相关知识,同时小编也会对龙神大陆兑换码进行解释,如果能解决您在龙神大陆方面面临的问题,请收藏关注本站,现在开始吧!恐龙宝贝之龙神勇士3全

极乐鸳鸯

极乐鸳鸯

求:古风短句版QQ个性签名-一季花落,落满地,一脸残笑,笑苍生。-忘不掉的是回忆,继续的是生活,苍了少年,老了天真,懒了声色,薄了青春,静了光阴,痛了灵魂。静水

宁缺毋滥的意思知了好学

宁缺毋滥的意思知了好学

宁缺毋滥拼音nìngquēwùlàn※提示拼音为程序生成因此多音字的拼音可能不准确。宁缺毋滥解释选拔人才或挑选事物宁可少。

青年年龄段划分最新标准

青年年龄段划分最新标准

本文向给大家分享青年年龄段相关知识,同时小编也会对青年年龄段是多少岁以上进行解释,如果能解决您在青年年龄段方面面临的问题,请收藏关注本站,现在开始吧!青年是什么

简单昵称好听干净的名552个(昵称简单干净)

简单昵称好听干净的名552个(昵称简单干净)

干净好听的昵称特别干净的名花独、蝶双飞迷失自我沧海一笑张望的时光青葱岁月临岸却孤独寒暄的遗憾回頭已無路酒拥知渔曼容北梦木。