本文章来介绍根据用户出生年月来计算年龄/生肖/星座的各种程序实例代码,各位朋友不防进入参考.
计算年龄,代码如下:
- function birthday($mydate){
- $birth=$mydate;
- list($by,$bm,$bd)=explode('-',$birth);
- $cm=date('n');
- $cd=date('j');
- $age=date('Y')-$by-1;
- if ($cm>$bm || $cm==$bm && $cd>$bd) $age++;
- return $age;
- //echo "生日:$birthn年龄:$agen";
- }
根据年份计算生肖,代码如下:
- <?php
- /**
- * 计算.生肖
- *
- * @param int $year 年份
- * @return str
- */
- function get_animal($year){
- $animals = array(
- '鼠', '牛', '虎', '兔', '龙', '蛇',
- '马', '羊', '猴', '鸡', '狗', '猪'
- );
- $key = ($year – 1900) % 12;
- return $animals[$key];
- }
- echo get_animal(1990); // 马
- echo get_animal(2010); // 虎
根据生日计算星座,代码如下:
- <?php
- /**
- * 计算.星座
- *
- * @param int $month 月份
- * @param int $day 日期
- * @return str
- */
- function get_constellation($month, $day){
- $signs = array(
- array('20'=>'宝瓶座'), array('19'=>'双鱼座'),
- array('21'=>'白羊座'), array('20'=>'金牛座'),
- array('21'=>'双子座'), array('22'=>'巨蟹座'),
- array('23'=>'狮子座'), array('23'=>'处女座'),
- array('23'=>'天秤座'), array('24'=>'天蝎座'),
- array('22'=>'射手座'), array('22'=>'摩羯座')
- );
- $key = (int)$month – 1;
- list($startSign, $signName) = each($signs[$key]);
- if( $day < $startSign ){
- $key = $month – 2 < 0 ? $month = 11 : $month -= 2;
- list($startSign, $signName) = each($signs[$key]);
- }
- return $signName;
- }
- echo get_constellation(12, 11); // 射手座
- echo get_constellation(6, 6); // 双子座
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
波比源码 » php根据生日计算年龄/生肖/星座实例
波比源码 » php根据生日计算年龄/生肖/星座实例
generic levaquin 500mg levaquin 500mg tablet
spironolactone us finasteride 1mg pill diflucan medication
buy acillin generic buy trimethoprim buy generic erythromycin 500mg
fildena 50mg cheap cheap fildena robaxin usa
buy suhagra generic buy sildalis pills estrace 2mg tablet
order generic lamotrigine mebendazole 100mg tablet retin cream tablet
buy tadalis 20mg online order generic diclofenac 50mg purchase voltaren generic
buy isotretinoin generic order azithromycin 250mg online cheap cheap zithromax 500mg
order indomethacin for sale buy indomethacin 50mg without prescription trimox for sale
order generic tadalafil 20mg Buy pfizer viagra in canada viagra 50mg for sale
buy generic anastrozole 1mg viagra kidney disease generic viagra 100mg
acheter tadalafil sildenafil 50mg sans ordonnance acheter 25mg sildenafil
deltasone 40mg drug mail order prescription drugs from canada order viagra 50mg online
cialis 10mg kaufen für männer cialis 10mg bestellen viagra 50mg generika rezeptfrei kaufen
buy accutane 40mg pill buy accutane 20mg pills ivermectin side effects
doxycycline pills generic furosemide 40mg buy furosemide online
buy generic catapres 0.1 mg spiriva price tiotropium bromide canada
hytrin for sale pioglitazone 30mg ca order sulfasalazine 500 mg without prescription
olmesartan online order buy acetazolamide online cheap oral diamox 250 mg
order tacrolimus 1mg generic labetalol 100mg cost buy ursodiol sale
buy isosorbide generic cheap lanoxin 250 mg telmisartan 20mg tablet
molnunat 200mg ca omnicef over the counter cheap lansoprazole 15mg
zoloft 50mg without prescription order lexapro pills sildenafil canada
us cialis buy fluoxetine 20mg sale buy viagra
order provigil 200mg for sale legal canadian prescription drugs online ivermectin 1%
purchase fluvoxamine online order fluvoxamine 100mg pills glipizide without prescription
cialis 40mg drug sildenafil for women viagra 50mg uk
best cialis sites online order clomipramine online clomipramine online buy
itraconazole 100 mg brand purchase tinidazole generic tindamax 300mg uk
order generic glycomet 1000mg cialis 5mg generic buy tadalafil pill
buy zyprexa 10mg generic bystolic 5mg uk valsartan 80mg for sale
cheap sildenafil online cheap sildenafil sale buy lisinopril generic
prilosec 20mg over the counter best real casino online best casino games
purchase metoprolol pill atenolol 50mg brand order vardenafil without prescription
levitra 10mg canada order levitra 10mg online methylprednisolone 4 mg pills
buy cialis 5mg without prescription viagra 100mg pill viagra 50mg uk
purchase dapoxetine without prescription cytotec 200mcg cost synthroid 75mcg generic
cialis for sales cheap inderal 20mg buy clopidogrel 75mg without prescription
order zyloprim 300mg generic order rosuvastatin 10mg without prescription buy zetia pills
buy methotrexate 5mg without prescription brand warfarin buy generic metoclopramide
purchase motilium generic buy cyclobenzaprine 15mg for sale flexeril order online
order losartan online cheap brand nexium buy topiramate 200mg pill
purchase baclofen online buy toradol 10mg for sale toradol without prescription
bonus poker online online gambling games world tavern poker online
tamsulosin 0.2mg cheap tamsulosin 0.2mg tablet aldactone generic
purchase simvastatin generic proscar usa buy propecia
diflucan 200mg usa viagra drug viagra mail order usa
cephalexin pills buy clindamycin sale purchase erythromycin pill
buy cefuroxime 250mg sale bimatoprost medication methocarbamol oral
trazodone 100mg generic buy trazodone 100mg pill cheap aurogra 100mg
sildenafil pills sildalis generic buy lamotrigine 200mg pills
viagra pills 25mg order sildenafil 100mg buy tadalafil for sale
buy zithromax 250mg sale gabapentin sale purchase neurontin pills
free spins no deposit canada buy provigil 100mg order modafinil generic
lasix 100mg for sale order plaquenil without prescription cheap plaquenil 400mg
buy sildenafil for sale sildenafil cheap order rhinocort without prescription
tretinoin sale order tadalafil pill buy avana generic
tadacip 20mg cheap buy indomethacin 75mg online cheap indomethacin 75mg pill
lamisil price lamisil for sale trimox 250mg pills
purchase clarithromycin pills clarithromycin 500mg brand meclizine 25mg canada
buy singulair 10mg online montelukast generic sildenafil citrate 50mg
female cialis pill Cialis overnight shipping order tadalafil 5mg online cheap
stromectol 12mg online buy stromectol 6mg without prescription buy dapsone 100mg online cheap
online casino roulette real casino online real money online blackjack
writing paper online sulfasalazine without prescription sulfasalazine 500 mg over the counter
buy olmesartan for sale cheap verapamil depakote 500mg drug
order diamox 250 mg pills imuran 25mg cheap azathioprine usa
brand clobetasol buy buspirone generic buy generic cordarone 100mg
cheap amoxil sale stromectol order ivermectin 6 tablet
order generic coreg order oxybutynin online cheap elavil 10mg over the counter
requip 2mg without prescription trandate 100 mg pills buy trandate 100mg online
tadacip 20mg drug tadacip generic trimox 250mg cheap
tricor 200mg cost order viagra 50mg pill sildenafil order
cost esomeprazole order generic biaxin order furosemide 40mg pills
buy tadalafil 40mg cialis buy over the counter ed pills
cost provigil stromectol for humans for sale phenergan uk
clomiphene brand order atorvastatin 20mg pills cost prednisolone
deltasone 5mg ca brand isotretinoin 10mg amoxil 1000mg us
isotretinoin price azithromycin 250mg cheap cost zithromax